In my Angular application I have a div with ui-view that will display a child state. During navigation to one of these states, I would like autoscroll='true' to occur, and to the other I'd like autoscroll='false' to occur. How can I implement this behavior?
1 Answer
you could expose $state from ui-router in the questionable scope and then do something along
autoscroll='$state.in("questionableState")'
3 Comments
Jack Guy
Does this work with the execution order of UI-router?
pierrebeitz
it is 2-way bound: github.com/angular-ui/ui-router/blob/…
Jack Guy
Thanks - I'm honestly shocked this works as smoothly as it does. Well done!