New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stateParams support in custom parent #48
Comments
I think you don't use the UI-router well: In your case, the .state('showArticle.editArticle', { // the dot defiines a parent/child relation
ncyBreadcrumb: {
label: 'Edit article {{ articleName }}',
parent: // No longer needed
},
url: '/edit', // Just the fragment after the parent state's url (no more duplicate)
views: {
'@' : { // target the root view like before if you don't want to rework yours views
controller: 'articleEditCtrl',
templateUrl: 'articleEdit.html'
}
}
}) BUT: have a look on #46: it allows url params when specifying In your case, something like this should do the job: .state('editArticle', {
ncyBreadcrumb: {
label: 'Edit article {{ articleName }}',
parent: function ($scope) {
var param = $scope.slug; // Or wherever is the slug value.
return 'showArticle({slug: ' + param + '})';
}
},
url: '/article/:slug/edit',
controller: 'articleEditCtrl',
templateUrl: 'articleEdit.html'
}) Pending the release, this feature is not yet documented. I strongly recommend you to use the first solution (UI-router configuration update) :-) |
Oh right, I was aware of parent/child system, but I missed that part : views: {
'@' : { // target the root view like before if you don't want to rework yours views
controller: 'articleEditCtrl',
templateUrl: 'articleEdit.html'
}
} That said, I'll keep in mind the other solution (in case of same parent, from different sources) |
Hi there, I am building your first solution @ncuillery but it doesn't keep the scoped variables in the parents.
Here I lose the client.enterprise when I move on detailsSite. Is it the expected behavior ? |
This works for me.
|
More specific than #32
It is possible to add param to a parent ?
Let's say I have something like this :
In order to end up with :
Home > An article > Edit
The text was updated successfully, but these errors were encountered: