angular-breadcrumb icon indicating copy to clipboard operation
angular-breadcrumb copied to clipboard

Dynamic parent label ?

Open lahsrah opened this issue 9 years ago • 1 comments

Say I am on this breadcrumb:

App > Products > Pepsi > Edit

The parent of "Edit" is the Product "Pepsi". Except the name "Pepsi" is coming from ProductController's $scope. Because this $scope doesn't exist on the Edit view, my breadcrumb appears as (note where is it should say Pepsi its just blank:

App > Products > > Edit

lahsrah avatar Mar 29 '16 02:03 lahsrah

I have the same issue. I set my Label in the ParentController (like you do with "Pespsi"). When I visit the EditContoller the ParentController is never fired, so the label isn't set.

E.g:

.state('modul.show', {
                url: '/:modulId',
                templateUrl: 'modul.tmpl.html',
                controller: 'ModulShowController',
                controllerAs: 'modul',
                ncyBreadcrumb: {
                    label: 'Modul {{short}}',
                    parent: 'modul.index'
                }
            })
 .state('exam.show', {
                url: '/:examId',
                templateUrl: 'exam.tmpl.html',
                controller: 'ExamShowController',
                controllerAs: 'exam',
                ncyBreadcrumb: {
                    label: 'Exam {{ date }}',
                    parent: 'modul.show'
                }
            });

Inside your ChildController you have to set a value for the short variable because the ModulShowController is not called. But I only tried with $scope, not with controllerAs.

cre8 avatar Apr 13 '16 13:04 cre8