Introduction to Angular UI Router
The core of Ionic Framework is an open source routing module called Angular UI Router. It implements states that are a part of a state machine represented by the complete app. In a normal Angular app, we use ngRoute
, which defines different routes, each of which can be associated with only a single ng-view
and one corresponding templateUrl
. In the UI Router, routes are represented by states (discussed in the following chapter).
States and URLs
In an app using the UI Router, the views are not tied up to the URL and hence you can change the parts of the app even without changing the URL. In any mobile app, the views are not so simple that they can be changed wholly but there is a complex hierarchy of views and sub-views that change based on different states. Due to this reason it is better to maintain states instead of routes and hence Ionic chose to use the Angular UI Router instead of ngRoute
. States are also defined in the config
section of an angular
module...