What is the difference between the Ngroute (Angular-route.js) and the Ui-router (angular-ui-router.js) modules?
Many articles say that Ngroute used $routeprovider when routing configuration, but used $stateProvider and $urlRouterProvider when Ui-router routing configuration.
So what's different about them?
1. Ngroute is the core part of the ANGULARJS framework.
2, Ui-router is a community library, it is used to improve the Ngroute routing function.
So which one, or what, is it better for manageability and for scalability?
The Ui-router router is a third-party module with very powerful features. It supports all normal ngroute and can do many additional functions.
Below are the common factors for choosing ui-router routers without ngroute.
- Ui-router routers allow for nested views (nested view) and multiple named Views (multiple named view). This is a very useful application and you may have more pages to inherit from other parts. @camnpr
- Ui-router allows you to have a state name based on the connection state between very strong types.
$stateProvider. State, { URL: '/' + LastState, controller: ' Ctrl. ' + State , templateurl: '/ views/' + path + '. html ' });
By building ui-sref to achieve different status links to different pages (or templates) @ Zhengzhou Network construction
<a ng-repeat= "CAMNPR in Group.items" ng-show= "{{camnpr.show}}" ui-sref= "{{camnpr.state}}" >{{item.label}}</ A>
At the same time your route can access dynamically created links
- States allows you to easily pass information through $statsparams, allowing different information for different states in the map format.
In summary, Angular-ui-router is a modular library of more powerful, easier-to-configure projects, and is an upgraded version of Ngrouter!
Purely reproduced notes, if there is infringement please inform!
What is the difference between the Ngroute (Angular-route.js) and the Ui-router (angular-ui-router.js) modules?