I have the following routing set up for my application:
$stateProvider
.state('mac', { // domain.com/mac
url: "/mac",
views: {
'body': {
templateUrl: 'partials/products/mac.body.html'
},
'content': {
templateUrl: 'partials/products/mac.home.html'
}
}
})
.state('mac.design', { // domain.com/mac/design
url: "/design",
views: {
'body': {
templateUrl: 'partials/products/mac.body.html'
},
'content': {
templateUrl: 'partials/products/mac.design.html'
}
}
})
.state('mac.features', { // domain.com/mac/features
url: "/features",
views: {
'body': {
templateUrl: 'partials/products/mac.body.html'
},
'content': {
templateUrl: 'partials/products/mac.features.html'
}
}
})
.state('iphone', { // domain.com/iphone
url: "/iphone",
views: {
'body': {
templateUrl: 'partials/products/iphone.body.html'
},
'content': {
templateUrl: 'partials/products/iphone.home.html'
}
}
})
...
The index.html looks like:
<div ui-view="body"></div>
And then inside mac.body.html:
<div ng-include="'partials/header.html'"></div>
<div class="view-container">
<div ui-view="content" class="view-frame"></div>
</div>
And then finally inside mac.home.html:
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h1>Mac</h1>
</div>
</div>
</div>
The body view loads in fine with the header include, but the content doesn't... Any ideas why?
The content file should be findable but I think I've ruled that out as the issue as if I replace the templateUrl with template: 'test content' that also does not appear... so it seems like it can't see the actual ui-view="content"
Another way to look at this:
.state('home', {
url: "/",
views: {
'layoutFile': {
templateUrl: 'partials/layoutDefault.html'
},
'contentFile': {
templateUrl: 'partials/home/index.html'
}
}
})
So basically I can choose which views show what. But it's how to get that contentFile view to be seen by the state when it's nested inside another like so...