Skip to content

Instantly share code, notes, and snippets.

@timmaybrown
Created July 8, 2015 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timmaybrown/ff6f00cb9fefc31f49c1 to your computer and use it in GitHub Desktop.
Save timmaybrown/ff6f00cb9fefc31f49c1 to your computer and use it in GitHub Desktop.
UI-Router targeting
$stateProvider
.state('logout', {
url: '/logout',
controller: 'LogoutCtrl',
controllerAs: 'vm'
})
.state('loginLayout', {
abstract: true,
//url: '/',
views: {
//pushes into unnamed ui-view in ROOT (index.html)
'@' : {
templateUrl: 'app/shared/loginLayout/loginLayout.html',
controller: 'LoginLayoutCtrl',
controllerAs: 'vm'
}
},
})
.state('login', {
url: '/login',
parent: 'loginLayout',
templateUrl: 'app/components/auth/login/login.html',
controller: 'LoginCtrl',
controllerAs: 'vm'
})
.state('root', {
abstract: true,
url: '^',
//url: '/',
views: {
//pushes into unnamed ui-view in ROOT (index.html)
'@' : {
templateUrl: 'app/shared/appLayout/appLayout.html',
controller: 'AppLayoutCtrl',
controllerAs: 'vm'
},
'header@root' : {
templateUrl: 'app/shared/appLayout/header/header.html'
},
'leftNav@root' : {
templateUrl: 'app/shared/appLayout/leftNav/leftNav.html',
controller: 'LeftNavCtrl',
controllerAs: 'vm'
}
},
})
.state('cp', {
abstract: true,
parent: 'root',
views: {
'ribbon@root' : {
templateUrl: 'app/shared/appLayout/ribbon/ribbon.html',
controller: 'RibbonCtrl',
controllerAs: 'vm'
}
},
data: {
proxy: 'cp.index'
}
})
.state('cp.index', {
url: '/cp',
views: {
'content@root' : {
templateUrl: 'app/components/controlPanel/controlPanel.html',
controller: 'ControlPanelCtrl',
controllerAs: 'vm'
}
},
data: {
displayName: 'Control Panel'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment