Created
June 7, 2014 16:49
-
-
Save charandas/660802f445a9edb06fe3 to your computer and use it in GitHub Desktop.
ui-router root controller in config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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