diff --git a/dist/angular-breadcrumb.js b/dist/angular-breadcrumb.js index 6d7f6ef..2a5bea1 100644 --- a/dist/angular-breadcrumb.js +++ b/dist/angular-breadcrumb.js @@ -1,8 +1,8 @@ -/*! angular-breadcrumb - v0.2.1-dev-2014-06-13 -* https://github.com/ncuillery/angular-breadcrumb -* Copyright (c) 2014 Nicolas Cuillery; Licensed MIT */ - -(function (window, angular, undefined) { +/*! angular-breadcrumb - v0.2.1-dev-2014-06-23 +* https://github.com/ncuillery/angular-breadcrumb +* Copyright (c) 2014 Nicolas Cuillery; Licensed MIT */ + +(function (window, angular, undefined) { function isAOlderThanB(scopeA, scopeB) { if(angular.equals(scopeA.length, scopeB.length)) { return scopeA > scopeB; @@ -184,6 +184,12 @@ function BreadcrumbDirective($interpolate, $breadcrumb, $rootScope) { angular.forEach(scope.steps, function (value) { if (value.data && value.data.ncyBreadcrumbLabel) { var parseLabel = $interpolate(value.data.ncyBreadcrumbLabel); + + viewScope.$watch(parseLabel, function(newParsed){ + console.log('parse', newParsed) + }); + + value.ncyBreadcrumbLabel = parseLabel(viewScope); } else { value.ncyBreadcrumbLabel = value.name; @@ -207,4 +213,4 @@ BreadcrumbDirective.$inject = ['$interpolate', '$breadcrumb', '$rootScope']; angular.module('ncy-angular-breadcrumb', ['ui.router.state']) .provider('$breadcrumb', $Breadcrumb) .directive('ncyBreadcrumb', BreadcrumbDirective); -})(window, window.angular); +})(window, window.angular); diff --git a/src/angular-breadcrumb.js b/src/angular-breadcrumb.js index 7cdd34e..6f5e739 100644 --- a/src/angular-breadcrumb.js +++ b/src/angular-breadcrumb.js @@ -179,7 +179,9 @@ function BreadcrumbDirective($interpolate, $breadcrumb, $rootScope) { angular.forEach(scope.steps, function (value) { if (value.data && value.data.ncyBreadcrumbLabel) { var parseLabel = $interpolate(value.data.ncyBreadcrumbLabel); - value.ncyBreadcrumbLabel = parseLabel(viewScope); + viewScope.$watch(parseLabel, function(newParsedLabel){ + value.ncyBreadcrumbLabel = newParsedLabel; + }); } else { value.ncyBreadcrumbLabel = value.name; }