ncuillery / angular-breadcrumb

Generate a breadcrumb from ui-router's states

Home Page:http://ncuillery.github.io/angular-breadcrumb/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Direct links & stateParams

ptitdje45 opened this issue · comments

Hi there,

I'm having a little issue with breadcrumb.

function getStates() { return [ { state: 'dashboard.opportunites.opportunite', config: { url: '/{idOppo:idOppo}', views: { '@': { templateUrl: 'app/opportunites/opportunite/opportunite.html', controller: 'OpportuniteController', controllerAs: 'vm' } }, title: 'Opportunite', ncyBreadcrumb: { label: '{{$stateParams.idOppo}}' } } } ]; }

And when i direct link into the app like http://XXXXXXXXX/dev/build/home/opportunites/1611_209, i have my {{$stateParams.idOppo}} consoled which give '1611 209' ( i encode decode for the '_' )

Did i miss something ? Thx by advance

And when i start from the http://XXXXXXXXX/dev/build/ route, i got my 1611 209 in the breadcrumb. Else it's empty.

`angular
.module('app.main')
.run(appRun);

/* @ngInject */
function appRun(routerHelper, $breadcrumb) {

}`

Injecting $breadcrumb direct in my run solved the problem of refreshing.