I've seen a few questions like this, so forgive me if I've overlooked a crucial detail from them.
When I load http://localhost:8000/characters/#/mages/detail/3
I get redirected to my 'otherwise' url: $urlRouterProvider.otherwise("/users");
But my state provider (if I've understood this correctly) should load the correct page:
$stateProvider
.state('users', {
url: "/users",
templateUrl: DjangoProperties.STATIC_URL + "partials/users.html"
})
.state('users.list', {
url: "/list",
templateUrl: DjangoProperties.STATIC_URL + "partials/users.list.html",
controller: 'UserListCtrl'
})
.state('users.detail', {
url: "/detail/{userID:int}",
templateUrl: DjangoProperties.STATIC_URL + "partials/users.detail.html",
controller: 'UserDetailCtrl'
})
.state('mages', {
url: "/mages",
templateUrl: DjangoProperties.STATIC_URL + "partials/mages.html"
})
.state('mages.list', {
url: "/list",
templateUrl: DjangoProperties.STATIC_URL + "partials/mages.list.html",
controller: 'MageCtrl'
})
.state('mages.detail', {
url: "/detail/{mageID:int}",
views:{
"@mage.detail": {
templateUrl: DjangoProperties.STATIC_URL + "partials/mages.detail.html",
controller: 'MageCtrl',
},
"characteristics@mage.detail": {
templateUrl: DjangoProperties.STATIC_URL + "common_partials/characteristics.html"
},
"attributes@mage.detail": {
templateUrl: DjangoProperties.STATIC_URL + "common_partials/attributes.html"
},
"skills@mage.detail": {
templateUrl: DjangoProperties.STATIC_URL + "common_partials/skills.html"
},
"spells@mage.detail": {
templateUrl: DjangoProperties.STATIC_URL + "partials/spells.html"
},
}
});
}]);
Here is my mages.html
:
<h1>Mages</h1>
<hr/>
<a ui-sref="mages.list">Show List</a>
<div ui-view></div>
and my mages.detail.html
<h4>{{mage.name}}</h4>
<div ui-view>
<div ui-view="characteristics"></div>
<div ui-view="attributes"></div>
<div ui-view="skills"></div>
<div ui-view="spells"></div>
</div>
None of these are loaded, just the default 'list' page.
I feel I've gotten muddled over my view names, but I can't figure out what to do to fix them?