The Difference Between Angular-route and Angular-ui-router

The ngRoute module, which provides routing, deep linking services, and directives for Angular applications, is developed by the AngularJS team, which was a part of the AngularJS core. The ui-router or angular-ui-router.js is a powerful third-party module that was made to improve and enrich routing capabilities.

The ui-router provides some advanced features:

  • It allows for nested views and several named views useful for large applications with pages inherited from other sections.
  • It provides strong-type linking between states based on state names. Changing the URL will update every link to that state. It is very useful for large projects where URLs might change.
  • The concept of the decorator allows the routes to be dynamically created based on the URL trying to be accessed.
  • The states allow mapping and accessing different kinds of information about different states. The information can be passed between states via $stateParams.
  • Your current state can be determined via $state provided by ui-router.

Basically, the ui-router is the same as ngRoute but with advanced features that are handy for larger applications.