I am using UI-Router and need a subview in another view. I need to render the "owner" view within the "dog" view. The following works for that purpose:
UI-Router config is as follows
.state('dogAbstract', {
url: '/dog/:dogId',
abstract: true,
templateUrl: 'client/dogs/views/dog.ng.html',
controller: 'dogCtrl',
})
.state('dog', {
url: "",
parent: "dogAbstract",
views: {
"owner": {
templateUrl: 'client/owners/views/owner.ng.html',
controller: 'ownerCtrl'
}
}
})
.state('dogsList', {
url: '/dogs',
templateUrl: 'client/moves/views/dogs-list.ng.html',
controller: 'dogsListCtrl',
})
The problem is that the url structure is suboptimal. Currently to access a specific "dog" you have to go to /dog/dogId
. However, I would like it to be /dogs/dogId
because that goes better with standard REST principles. Unfortunately, when I change the 'dogAbstract' url to /dogs
, it conflicts with the "dogsList" page, and I can only have one or the other.
Is there a way to make it work so that I can have the list at /dogs
and view an individual dog at /dogs/dogId
?