Dynamic breadcrumb with resolve variable
See original GitHub issuehi, im not sure if i am doing this right but… I have this state:
.state('main.applications.fase.utilizador.show', {
url: '/:idUser',
resolve: {
user: ['$state', '$stateParams', 'User',
function ($state, $stateParams, User) {
return User.getFromDB($stateParams.idUser, {
'fromAD': false,
'include': 'aluno,aluno.escolas,aluno.cursos,aluno.anosLetivos'
}).then(function (user) {
return user;
})
}]
},
views: {
'fase@main.applications.fase': {
templateUrl: 'app/applications/fase/utilizador/show.html',
controller: 'app.applications.fase.UtilizadorCtrl',
controllerAs: 'vm'
}
},
ncyBreadcrumb: {
label: 'app.fase.perfil.label'
}
});
And I want the label to be the user.id (user is on resolve) is it possible to do this? Use the resolve variables to dynamically do the ncy label?
Another thing, if i use controller as vm how can i use scope to make a dynamic label with {{ }} ?
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
Angular breadcrumbs with dynamic label - Stack Overflow
The interface defines a resolve() method that is invoked when the navigation starts. The router waits for the data to be resolved before...
Read more >Build dynamic breadcrumb routes and child routes with ...
My current understanding is that React Router and nested routes seem to work by each level of the router owning its own routes...
Read more >Implement a Dynamic Breadcrumb in React/NextJS
Breadcrumbs are a website navigation tool that allows a user to see their current page's "stack" of how it is nested under any...
Read more >Angular Breadcrumbs with Complex Routing and Navigation
URL segment, matrix, and query parameters; Active router links and styles; Route guards; Primary and secondary routes; Lazy-loading or dynamic- ...
Read more >Rails Tutorial | Adding Dynamic Breadcrumbs to a Rails App
In this Ruby on Rails tutorial, we're going to create a method for easily adding dynamic breadcrumbs to our application without complex ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This should be possible by setting
{{ vm.user.id }}as the label. Unfortunately, in my case, this does not work when you refresh the page. The label will remain empty (this seems like a bug but I haven’t reproduced this in a plunkr). So this will only work when you click from another page to /:idUser page.Another possibility is to update the label in your controller, by doing:
@go4varuntyagi : I used both
Instead of only
$state.current.ncyBreadcrumb.label = 'Your custom breadcrumb here'and it worked.