What is the difference between the Ngroute (Angular-route.js) and the Ui-router (angular-ui-router.js) modules?

Source: Internet
Author: User

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 '   }); 

      Linking different states to different pages (or templates) by building Ui-sref

      <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!

What is the difference between the Ngroute (Angular-route.js) and the Ui-router (angular-ui-router.js) modules?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.