ui-router-extras icon indicating copy to clipboard operation
ui-router-extras copied to clipboard

Sticky States and parameters

Open sfug opened this issue 9 years ago • 5 comments

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?

sfug avatar Oct 21 '15 21:10 sfug

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?

christopherthielen avatar Oct 21 '15 22:10 christopherthielen

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.

sfug avatar Oct 22 '15 12:10 sfug

Did you find a solution for this use case @sfug?

AlexDubstone avatar May 03 '16 09:05 AlexDubstone

Nope, Alex.

Ended up implementing a tab directive that uses ng-show and ng-hide to retain state.

sfug avatar May 03 '16 12:05 sfug

Thank you for your feedback. Guess I'll try achiving it in a similar way then.

AlexDubstone avatar May 03 '16 14:05 AlexDubstone