Jack Guy
Jack Guy

Reputation: 8523

Angular UI router conditional autoscroll

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?

Upvotes: 0

Views: 109

Answers (1)

pierrebeitz
pierrebeitz

Reputation: 221

you could expose $state from ui-router in the questionable scope and then do something along

autoscroll='$state.in("questionableState")'

Upvotes: 1

Related Questions