Search code examples
javascriptangularjsangular-ui-routersticky

Exit sticky state in ui-router


I have my /home as a sticky state (reasons about why I have set it up like this are out of the scope of this question) and I have a few links (ui-sref).

I realized that the only way other states will draw is by adding ui-sref-opts="{reload: true}" to each ui-sref, but I'm not really sure I understand why this is happening or if that is the right way of "exiting" a sticky state.

Are there any better ways of exiting a sticky state? What does reload implies?


Solution

  • I found it. ui-sref-opts="{exitSticky: 'the-name-of-my-sticky-state'}"

    Source: https://github.com/ui-router/sticky-states/issues/5