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
世界只因有你2017-05-15 16:52:26
为情所困2017-05-15 16:52:26
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.