I want to use a stateprovider view template in all modules..
so, in index.html i have this:
<div ui-view="nav"></div>
<div ui-view></div>
<div ui-view="footer"></div>
then my config is this:
$urlRouterProvider.otherwise('/');
$stateProvider.
state("home",
{
url: "/",
views: {
"": {
templateUrl: "main.html"
},
"nav": {
templateUrl: "modules/nav/nav.html"
},
"footer": {
templateUrl: "modules/footer/footer.html"
}
}
});
this works pretty fine for the root and default route, but if i navigate to localhost:8000/page1 for example, the nav and footer is not visible with this config:
$stateProvider.
state("page1",
{
url: "/page1",
views: {
"": {
templateUrl: "modules/page1/page1.html"
}
}
});
when i add then the nav and footer view with template to the config, then it is working of course. But i do not want to add these same views and templateUrls to all my pages and modules.. can i define that somehow that it is valid everywhere what i defined in my main config for the default route?
or do i have to use ng-include? because with ng-include works fine, but i think it would be nicer with ui-view :)
does anyone has a solution for that?
thank you very much