0

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?

fun_hat
  • 547
  • 2
  • 7
  • 25

1 Answers1

0

ui-sref="page({name: 'name', '#': 'frag'})" or $state.go('page', {name: 'name', '#': 'frag'}) should do the trick.

Kyle Krzeski
  • 6,183
  • 6
  • 41
  • 52
  • I just tried the first one but it didn't do anything. Does it have to occur on a state change? I am trying to link to a different spot on the same page. – fun_hat Jun 16 '17 at 20:13