Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/angular-breadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,14 @@ function BreadcrumbDirective($interpolate, $breadcrumb, $rootScope) {
scope.steps = $breadcrumb.getStatesChain();
angular.forEach(scope.steps, function (step) {
if (step.ncyBreadcrumb && step.ncyBreadcrumb.label) {
var parseLabel = $interpolate(step.ncyBreadcrumb.label);
step.ncyBreadcrumbLabel = parseLabel(viewScope);
// Watcher for further viewScope updates
registerWatchers(labelWatchers, parseLabel, viewScope, step);
if (typeof step.ncyBreadcrumb.label === 'function') {
step.ncyBreadcrumbLabel = step.ncyBreadcrumb.label(viewScope);
} else {
var parseLabel = $interpolate(step.ncyBreadcrumb.label);
step.ncyBreadcrumbLabel = parseLabel(viewScope);
// Watcher for further viewScope updates
registerWatchers(labelWatchers, parseLabel, viewScope, step);
}
} else {
step.ncyBreadcrumbLabel = step.name;
}
Expand Down