简体   繁体   中英

Dynamic changing of ui-sref attribute in ui-router

I have issue with dynamic changing ui-sref. I'm change ui-sref attr but when click on link with updated ui-sref it redirect to old state that was defined on this link.

It's look like it bind data at init and after changing ui-sref attr nothing changed.

<a  href="" ui-sref="{{navigatorNames.previous.stateName}}" >{{navigatorNames.previous.title}}</a> |
<a  href="" ui-sref="{{navigatorNames.current.stateName}}">{{navigatorNames.current.title}}</a> |
<a  href="" ui-sref="{{navigatorNames.next.stateName}}" >{{navigatorNames.next.title}}</a>

full code here http://plnkr.co/edit/qrDPBE?p=info

It's look like it bind data at init and after changing ui-sref attr nothing changed.

You are right, I think this is the way it is designed.

You can check this github post, people are talking about issues which are quite close to yours I think:

https://github.com/angular-ui/ui-router/issues/395

Some of them just solved the problem by updating angular and ui-router.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM