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

Parallel state handling

Open mateusleon opened this issue 13 years ago • 8 comments

Sorry to disturb this issue list with this question but I really don't have a clue about it.

It's possible to set the ui-router to change one view without changing any other, without the need to declare them?

For example: when navigating on the app, some actions are pointed to one view: the view A. However, the user can click on one link that is pointed to other view in the application: the view B. What I need is change the view B letting the view A on the same state that the user choosed before clicking on the link that changes the view B.

It's like working with and Frame-Based app, because any frame is navigable independently, however it's possible to exchange info between them.

If isn't possible to do that on the current release I suggest this implementation, because is realy handy and provides the ability to create dynamic states independently.

Here's the Plunkr with a close behavior: http://plnkr.co/edit/wJXx9R.

mateusleon avatar Sep 30 '13 22:09 mateusleon

I'll second this question. I think this would be incredibly useful.

As another example, I'll describe the problem I'm working on:

There's the page you're currently on (the root view). There's a number of filters that can be used to narrow the results (nested view). There's the results area (nested view).

The filters are rather complicated, so each category of filter I intended to be a separate template that gets loaded into the filter view. However, I don't want these to interfere or reload the results section.

The results section also has multiple views associated with it that I don't want to interfere with the filter section.

Now that I've typed that out, maybe managing that with UI-Router isn't the best route, but I still think the idea would be very useful. (Note, I think this is similar to this issue: https://github.com/angular-ui/ui-router/issues/384 )

joshmatz avatar Oct 02 '13 18:10 joshmatz

This isn't currently possible, but the next version will provide the ability to manipulate views independently of states, which should allow you an approximation of what you're looking for.

nateabele avatar Oct 02 '13 19:10 nateabele

Excellent! Thanks for the reply on this.

joshmatz avatar Oct 02 '13 19:10 joshmatz

@nateabele, I see the branch you've started work on. Is that useable at this point?

zdennis avatar Oct 02 '13 20:10 zdennis

@zdennis I'm honestly not sure. I started coding it against an app, but have been refactoring to pass tests. Take a crack at it.

nateabele avatar Oct 02 '13 20:10 nateabele

Thanks for the reply, I was struggling with this. On the app that I'm working on, I separated the views and applied the state handling to the main view.

This will be really useful to build even more complex app systems.

mateusleon avatar Oct 03 '13 15:10 mateusleon

We are also experiencing this issue but using a named view for a modal handler. It is very important for us to be able to specify a single named view to change.

In the same way, it would be very nice to be able to ask to change a single view, and set the others if they are uninitialized.

Scenario being if you hit #/login from deep within the page it opens view c without effecting view a or b. If you hit #/login directly it will populate view a and b with a default state, f.e. the home page.

deedubs avatar Oct 30 '13 20:10 deedubs

https://gist.github.com/eddiemonge/f6a58169c2846731a1eb

eddiemonge avatar Aug 03 '15 21:08 eddiemonge