Skip to main content

iI am building an angular plugin named breadcrumb here, it works fine until iI update ui-router version to '1.0.0-beta.2'. the cause is that iI can't get resolved data from $state.$current.

in html

specify display name property to data.displayName in html

<breadcrumbs display-name-property="data.displayName"></breadcrumbs> 

state config

displayName is dynamic

.state('app.dict.list.tree', { ... data: { displayName: '{{title}}' }, resolve: { title: ['$transition$', $transition$ => $transition$.params().title], } }) 

directive link function

i use $interpolate service to compile propertyReference(in this case '{{title}}') with the context $state.$current.locals.global.

var currentState = $state.$current; interpolationContext = (typeof currentState.locals !== 'undefined') ? currentState.locals.globals : currentState; displayName = $interpolate(propertyReference)(interpolationContext); 

update ui-router to the latest version, this code won't work anymore, currentState.locals is undefined, and iI can't find a way to access resolved data in currentState object.

does anybody know how to do it? any help will be appreciated.

i am building an angular plugin named breadcrumb here, it works fine until i update ui-router version to '1.0.0-beta.2'. the cause is that i can't get resolved data from $state.$current.

in html

specify display name property to data.displayName in html

<breadcrumbs display-name-property="data.displayName"></breadcrumbs> 

state config

displayName is dynamic

.state('app.dict.list.tree', { ... data: { displayName: '{{title}}' }, resolve: { title: ['$transition$', $transition$ => $transition$.params().title], } }) 

directive link function

i use $interpolate service to compile propertyReference(in this case '{{title}}') with the context $state.$current.locals.global.

var currentState = $state.$current; interpolationContext = (typeof currentState.locals !== 'undefined') ? currentState.locals.globals : currentState; displayName = $interpolate(propertyReference)(interpolationContext); 

update ui-router to latest version, this code won't work anymore, currentState.locals is undefined, and i can't find a way to access resolved data in currentState object.

does anybody know how to do it? any help will be appreciated.

I am building an angular plugin named breadcrumb here, it works fine until I update ui-router version to '1.0.0-beta.2'. the cause is that I can't get resolved data from $state.$current.

in html

specify display name property to data.displayName in html

<breadcrumbs display-name-property="data.displayName"></breadcrumbs> 

state config

displayName is dynamic

.state('app.dict.list.tree', { ... data: { displayName: '{{title}}' }, resolve: { title: ['$transition$', $transition$ => $transition$.params().title], } }) 

directive link function

i use $interpolate service to compile propertyReference(in this case '{{title}}') with the context $state.$current.locals.global.

var currentState = $state.$current; interpolationContext = (typeof currentState.locals !== 'undefined') ? currentState.locals.globals : currentState; displayName = $interpolate(propertyReference)(interpolationContext); 

update ui-router to the latest version, this code won't work anymore, currentState.locals is undefined, and I can't find a way to access resolved data in currentState object.

does anybody know how to do it? any help will be appreciated.

Source Link

how to get resolved data in $state object with ui-router 1.0

i am building an angular plugin named breadcrumb here, it works fine until i update ui-router version to '1.0.0-beta.2'. the cause is that i can't get resolved data from $state.$current.

in html

specify display name property to data.displayName in html

<breadcrumbs display-name-property="data.displayName"></breadcrumbs> 

state config

displayName is dynamic

.state('app.dict.list.tree', { ... data: { displayName: '{{title}}' }, resolve: { title: ['$transition$', $transition$ => $transition$.params().title], } }) 

directive link function

i use $interpolate service to compile propertyReference(in this case '{{title}}') with the context $state.$current.locals.global.

var currentState = $state.$current; interpolationContext = (typeof currentState.locals !== 'undefined') ? currentState.locals.globals : currentState; displayName = $interpolate(propertyReference)(interpolationContext); 

update ui-router to latest version, this code won't work anymore, currentState.locals is undefined, and i can't find a way to access resolved data in currentState object.

does anybody know how to do it? any help will be appreciated.