ui-router-extras
ui-router-extras copied to clipboard
Sticky States and parameters
Hi Christopher,
Not really an issue, but I don't know where else to ask this. Given that sticky states doesn't support multiple tabs of the same state with different parameters, what would you suggest as a solution for this scenario?
I haven't found a clear solution to implement that use case with ui-router states. Maybe you can ng-repeat some custom directive, then show/hide the appropriate one.
What goes on in that state in your app?
Thanks for the reply, Christopher. Awesome work, by the way.
The app's requirements are not quite clear to me at the present time, but as far as I know it's a "tab-oriented" ticketing system. In other words, there's no actual 'navigation' - most actions will cause a new tab to be opened in a container. Answering your question: once a "sticky tab state" is created, it will contain its own 'substates'.
That would require 'ticket/1' and 'ticket/2', for instance, to be two different and parallel states, each with its own subtree of states.
I was thinking of registering "Future Sticky States" as new tabs are requested (such as 'ticket1', 'ticket2' and so on), but I don't know if that would work or if it would turn things overly complex. I will give it a try, anyway :) If that doesn't work out, I don't see any other solution other than dropping uiRouter altogether.
Did you find a solution for this use case @sfug?
Nope, Alex.
Ended up implementing a tab directive that uses ng-show and ng-hide to retain state.
Thank you for your feedback. Guess I'll try achiving it in a similar way then.