ncuillery / angular-breadcrumb

Generate a breadcrumb from ui-router's states
http://ncuillery.github.io/angular-breadcrumb/
MIT License
786 stars 183 forks source link

TypeError: Cannot read property 'ncyBreadcrumb' of null #177

Open princeofforest opened 7 years ago

princeofforest commented 7 years ago

When i try 3 level, the ncy broke down

                ncyBreadcrumb: {
                    label: 'Create Reservation',
                    parent:'admin.level1.level2'
                },

<ol class="breadcrumb">
    <li ng-repeat="step in steps" ng-class="{active: $last}" ng-switch="$last || !!step.abstract">
        <a ng-switch-when="false" href="{{step.ncyBreadcrumbLink}}">{{step.ncyBreadcrumbLabel | translate}}</a>
        <span ng-switch-when="true">{{step.ncyBreadcrumbLabel | translate}}</span>
    </li>
</ol>

angular-breadcrumb - v0.4.0

please advise! thank you very much

abhipanda commented 7 years ago

This error comes when you don't have

 ncyBreadcrumb: {

                }

in any of your parent states.

learnangular2 commented 7 years ago

I also got this error and it was because of a missing configuration -

.config(['$breadcrumbProvider',function($breadcrumbProvider){ $breadcrumbProvider.setOptions({ prefixStateName:'home'

        });
 }])
learnangular2 commented 7 years ago

This may not be applicable to the scenario explained above, but in case someone else run in to the same issue.