Open TheCodeDestroyer opened 9 years ago
Hi,
Does it fit to your needs ? https://github.com/angular-ui/ui-router/wiki#attach-custom-data-to-state-objects
Hey!
Sorry for late reply. Regarding the options, I'm not sure if we understood each other, what I meant by state options was: Example:
ncyBreadcrumb: {
stateOptions: {
reload: true
}
}
If we have this config, then this would be passed into $state.go() function or to ui-sref-opts directive.
So like in example above if I wanted to reload my state the call in backend would be
$state.go('state name', {}, ncyBreadcrumb.stateOptions) <- which has reload: true property inside
Hope I was more clear this time :)
I see in the source that you are actually calling $state.href()
method,
which sadly doesn't have many options.
Is there a particular reason for this method,
instead of .go()
or transitionTo()
?
I also need stateOptions.reload
.
Here's my situation: https://github.com/angular-ui/ui-router/issues/1791
With reload: true
I could fix problem in no time.
Bump. I need this too.
Hey @ncuillery, Thanks for the great lib. I also need the state option for breadcrumb since I want to have the reload option. Should I start working on it and send a PR or is it something you are currently working on right now?
Hi,
As you can see in history, I lack time to maintain this module. I don't have work in progress. PR are greatly welcome :smile:
I see ;) Using this library can solve your problems with stateOptions
I am not sure if you still have the problem @TheCodeDestroyer but I found a solution. You just have to use this line for the tag <a>
on the breadcrumbs template:
<a ng-switch-when="false" href="{{step.ncyBreadcrumbLink}}" ui-sref="{{ step.ncyBreadcrumbStateRef }}" ui-sref-opts="{reload: true, absolute: true}" ng-bind-html="step.ncyBreadcrumbLabel"></a>
The key is use the value of step.ncyBreadcrumbStateRef
to build the ui-sref
with the ui-sref-opts
.
Hey!
I was wondering is there a way that some state options could be passed in? Example:
That would be very awesome...