Skip to content

Instantly share code, notes, and snippets.

@charandas
Created June 7, 2014 16:49
Show Gist options
  • Save charandas/660802f445a9edb06fe3 to your computer and use it in GitHub Desktop.
Save charandas/660802f445a9edb06fe3 to your computer and use it in GitHub Desktop.
ui-router root controller in config
app.config(function($stateProvider, BaseSettingsService, PrintSettingsService) {
$stateProvider
// All app states loaded in index.html
.state('app', {
abstract: true,
templateUrl: 'views/app.html',
controller: 'AppCtrl',
resolve: {
baseSettings: settings: function(BaseSettingsService) {
return BaseSettingsService.all();
}
}
})
.state('app.home', {
url: '/',
templateUrl: 'views/core/home.html',
controller: 'HomeCtrl'
})
... so on
// All print states loaded in print.html
.state('print', {
abstract: true,
template: '<ui-view/>',
controller: 'PrintCtrl'
resolve: {
printSettings: function(PrintSettingsService) {
return PrintSettingsService.all();
}
}
})
.state('print.assets', {
url: '/assets/:assetName',
templateUrl: 'views/core/asset-print.html',
controller: 'AssetPrintCtrl'
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment