I'm building a MEAN application and having troubles dealing with ui-router. I have an index.html
where i have the template of the entire website with a header, sidebar and a content where i place <div ui-view>
. In this file I also load every javascript necessary like angular, ui-router, bootstrap, ocLazyLoad, etc.
Every partial view are placed in index.html
content with ui-router states. My ui-router is configured this way:
myApp.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('home', {
url: '/home',
templateUrl: '../views/home.html',
resolve: {
deps: ['$ocLazyLoad', function ($ocLazyLoad) {
return $ocLazyLoad.load([{
name: 'myApp',
files: [
'js/controllers/homeCtrl.js'
]
}]);
}]
}
})
});
Up to now I have everything controlled. My problem is this: How can i create a state login.html
that does not have the header and the sidebar, because if the user is not logged in i don't want to show any options but login. How is the safest and best way to achieve this?
Thanks in advance.