ionic Navigation
ion-nav-view
When a user browses in your app, ionic can detect the browsing history. By detecting the browsing history, views can be correctly transitioned when swiping left or right.
Using application interfaces such as the AngularUI Router module, you can divide into different $states. Angular's core is the routing service, and URLs can be used to control views.
AngularUI Router provides more powerful state management, where states can be named, nested, and have merged views, allowing more than one template to be presented on the same page.
In addition, each state does not need to be bound to a URL, and data can be pushed to each state more flexibly.
In the following example, we will create a navigation view with different states in an application.
In our markup we choose ionNavView as the top-level directive. To show a header bar we use the ionNavBar directive to update through navigation.
Next, we need to set the state values that will be rendered.
var app = angular.module('myApp', ['ionic']);
app.config(function($stateProvider) {
$stateProvider
.state('index', {
url: '/',
templateUrl: 'home.html'
})
.state('music', {
url: '/music',
templateUrl: 'music.html'
});
});
When the app is opened again, $stateProvider queries the url to see if it matches the index state value, then loads index.html into
Page loading is all configured through URLs. The simplest way to create a template in Angular is to put it directly in an html template file and use