Skip to content

Instantly share code, notes, and snippets.

@popcorn245
Created July 28, 2015 19:18
Show Gist options
  • Save popcorn245/7a7a6aaa39db41bd8c56 to your computer and use it in GitHub Desktop.
Save popcorn245/7a7a6aaa39db41bd8c56 to your computer and use it in GitHub Desktop.
Standard Ionic Router
app.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('login', {
url: '/login',
templateUrl: 'html/login.html',
controller: 'Login'
})
.state('tab', {
url: "/tab",
abstract: true,
templateUrl: "html/tabs.html"
})
.state('tab.dashboard', {
url: '/dashboard',
views: {
'tab-dashboard': {
templateUrl: 'html/tab-dashboard.html',
controller: 'Dashboard'
}
}
})
.state('tab.search', {
url: '/search',
views: {
'tab-search': {
templateUrl: 'html/tab-search.html',
controller: 'Search'
}
}
});
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/login');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment