I've written a breadcrumb directive which takes an array of crumbs, each with a name and sref property. I'm trying to bind the ui-sref directive ($StateRefDirective) to use the evaluated attribute, but it's not working. When the ui-sref directive's link function is called, the attrs.uiSref value is undefined, but immediately after the running of the function becomes available as the correct value.
angular.module('myApp').directive'breadcrumb', ->scope: { crumbs:'=' }
replace:truetemplate:' <nav class="breadcrumbs"> <a ui-sref="{{crumb.sref}}" ng-repeat="crumb in crumbs">{{crumb.name}}</a> </nav>'Inside the $StateRefDirectivelink method, logging attrs gives
Attributes{… uiSref: undefined…}Running the same log after a 100ms timeout gives:
Attributes{… uiSref: "apps.show({appId: crumb.app.id})"…}Am I doing something wrong, or are dynamic ui-sref attributes not supported?
Note: Running v0.2.0
I've written a breadcrumb directive which takes an array of crumbs, each with a name and sref property. I'm trying to bind the
ui-srefdirective ($StateRefDirective) to use the evaluated attribute, but it's not working. When theui-srefdirective'slinkfunction is called, theattrs.uiSrefvalue isundefined, but immediately after the running of the function becomes available as the correct value.Inside the
$StateRefDirectivelinkmethod, loggingattrsgivesRunning the same log after a 100ms timeout gives:
Am I doing something wrong, or are dynamic
ui-srefattributes not supported?Note: Running
v0.2.0