Method 1: Use ngRoute that comes with angular Dependency: angular-route.js (bower install angular-route) Website: http://docs.angularjs.cn/api/ngRoute/service/$route#example Usage : a. You need to use the ng-view command in the ui to specify such as: <p ng-view></p> This is equivalent to the refresh area of the page b. Configuration registration
Method 2: Use third-party ui-router Dependency: angular-ui-router.js (bower install angular-ui-router) Website: https://github.com/angular-ui/ui-router Usage: a. You need to specify the ui-view command in ui, such as: <p ui-view></p> This is equivalent to the refresh area of the page b. Configuration registration
Method 1: Use ngRoute that comes with angular
Dependency: angular-route.js (bower install angular-route)
Website: http://docs.angularjs.cn/api/ngRoute/service/$route#example
Usage :
a. You need to use the ng-view command in the ui to specify such as: <p ng-view></p> This is equivalent to the refresh area of the page
b. Configuration registration
Method 2: Use third-party ui-router
Dependency: angular-ui-router.js (bower install angular-ui-router)
Website: https://github.com/angular-ui/ui-router
Usage:
a. You need to specify the ui-view command in ui, such as: <p ui-view></p> This is equivalent to the refresh area of the page
b. Configuration registration
You can refer to some articles for detailed usage and differences, each has its own advantages and disadvantages
For single-page applications, you need to use $router to match the url and templatecontroller.
If you don’t write a single-page application, it is a normal page address.
The above has been fully explained. The usual method is to use ui-router to jump to the state you defined, such as this.