Skip to content

Instantly share code, notes, and snippets.

@Sebfh
Created October 29, 2014 10:57
Show Gist options
  • Save Sebfh/a71b47ad4fb20b01165e to your computer and use it in GitHub Desktop.
Save Sebfh/a71b47ad4fb20b01165e to your computer and use it in GitHub Desktop.
UI-Router problem
$urlRouterProvider.when('/admin', '/admin/dashboard');
$stateProvider
.state('root', {
abstract: true,
url: '',
views: {
'main-layout': {
templateUrl: '/views/layouts/main.html'
}
}
})
.state('root.home', {
url: '/',
views: {
'header': {
templateUrl: '/views/shared/public.header.html'
},
'main': {
templateUrl: '/views/home/index.html'
},
'footer': {
templateUrl: '/views/footer/public.html'
}
}
})
.state('root.news', {
url: '/news',
views: {
'header': {
templateUrl: '/views/shared/public.header.html'
},
'main': {
templateUrl: '/views/news/news.list.html'
},
'footer': {
templateUrl: '/views/footer/public.html'
}
}
})
.state('root.information', {
url: '/information',
views: {
'header': {
templateUrl: '/views/shared/public.header.html'
},
'main': {
templateUrl: '/views/information/information.list.html'
},
'footer': {
templateUrl: '/views/footer/public.html'
}
}
})
.state('root.admin', {
url: '/admin',
views: { // this is never shown. Should be solved different
'header': {
templateUrl: '/views/shared/admin.header.html'
},
'main': {
templateUrl: '/views/admin/dashboard.html'
},
'footer': {
templateUrl: '/views/footer/public.html'
}
}
})
.state('root.admin.spotlight', {
url: '/spotlight',
views: {
'header': {
templateUrl: '/views/shared/admin.header.html'
},
'main': {
templateUrl: '/views/admin/spotlight.html'
},
'footer': {
templateUrl: '/views/footer/public.html'
}
}
})
.state('root.admin.dashboard', {
url: '/dashboard',
views: {
'header': {
templateUrl: '/views/shared/admin.header.html'
},
'main': {
templateUrl: '/views/admin/dashboard.html'
},
'footer': {
templateUrl: '/views/footer/public.html'
}
}
});
$locationProvider.html5Mode(true);
@Sebfh
Copy link
Author

Sebfh commented Oct 29, 2014

/admin/spotlight is not showing
/admin/dashboard is showing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment