tdg5 / angular-ui-router-breadcrumbs

angular-ui-router state derived breadcrumbs
MIT License
33 stars 7 forks source link

Not working with angular-ui-router 1.0.1 #3

Closed Debananda closed 7 years ago

Debananda commented 7 years ago

directive stopped working after angular-ui-router update to 1.0.1

<li ng-repeat="breadcrumb in breadcrumbs">
    <a data-ng-if="breadcrumb.stateName != vm.currentState.name" ui-sref="{{breadcrumb.stateName}}">{{breadcrumb.text | translate}}</a>
    <span data-ng-if="breadcrumb.stateName == vm.currentState.name">{{breadcrumb.text | translate}}</span>
</li>
angular.module("ng2Portal")
        .config(["$stateProvider", "$urlRouterProvider", function($stateProvider, $urlRouterProvider) {
            $urlRouterProvider.otherwise('/notifications');
            $stateProvider
            .state('notifications', {
                breadcrumb: 'NOTIFICATIONS_TITLE_TEXT',
                url: '/notifications',
                views:{
                    "@":{  templateUrl: 'notifications/seeAllNotifications.html'    }
                }
            }).state('notifications.settings', {
                breadcrumb: 'SETTINGS_TEXT',
                url: '/settings',
                views:{
                    "@":{  templateUrl: 'notifications/settings.html'   }
                }
            });
Debananda commented 7 years ago

By adding state change event polyfill ./bower_components/angular-ui-router/release/stateEvents.js as described in https://ui-router.github.io/guide/ng1/migrate-to-1_0 the issue get resolved