Write the following route
javascript
$routeProvider.when('/tweet/:name?', { controller: ArticleController, templateUrl: templateUrl }).when('/project/:name?', { controller: ArticleController, templateUrl: templateUrl }).when('/technique/:name?', { controller: ArticleController, templateUrl: templateUrl }).when('/about-me', { controller:ArticleController, templateUrl: templateUrl }).otherwise({ redirectTo: '/tweet' });
But the above settings have no effect when the page is opened for the first time
The corresponding view will not be rendered
Probably because the angularjs script is executed after loading the page for the first time
At this time, the page has been loaded, so the view is not rendered
Is that so?
Websiteblog
If the routing is configured, it will be executed when the page is loaded for the first time. You can check the following aspects to see if there are any problems:
I don’t know if it can solve your problem.
angular routing will not render all the pages, so when you open the page for the first time, you will go to the /tweet page and other pages will not be rendered
It will only be rendered when you click on other pages. If /tweet is not displayed, there must be a problem with the code.