How to implement a change of layout `s in the application?
There is an application with the possibility of authorization, after authorization you need to change the basic layout, there is 2 layout `a: for the guest and for the authorized user.
At the moment there is such an implementation: using two root abstract state `s:
$stateProvider // Для гостя .state('site', { abstract: true, views: { '' : { templateUrl: 'site.html'}, } }) // Для авторизированного .state('main', { abstract: true, views: { '' : { templateUrl: 'main.html'}, } })
Then in the modules that are accessible only by authorized users, the parent state "main" is used.
$stateProvider // главная страница для гостя .state('site.home', { url: "/", views: { header: ..., body: ..., footer: ... } }) // главная страница для пользователя .state('main.home', { url: "/", views: { header: ..., body: ..., footer: ... } })
This option is not convenient because you need to be attached to the state of the main module (app), advise implementation options, so to speak BEST PRACTICE.