简体   繁体   中英

Anchor linking with UI Router

I found answers on here (option 3) that indicated that by adding target="_self" to an href, you could do anchor linking with Angular. I tried this out, but my app uses Ui Router, and it appears that this option does not work, as on click I was getting a state change to my default route.

Is there a way to achieve anchor linking in a way similar to what is shown in the answer above, but with UI Router?

ui-sref="page({name: 'name', '#': 'frag'})"$state.go('page', {name: 'name', '#': 'frag'})应该可以。

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