Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change only one view on state change in ui.router?

I have a simple layout like so:

__________________  ________
|                |  | Side |
|  Main section  |  | -bar |
|________________|  |______|

The "Main section" exposes forms to the user; based on their selection that "Main section" state should change (i.e.: a different partial should be loaded). How do I facilitate this with UI.router?

E.g.: change only columnOne in the /about state: http://plnkr.co/edit/IzimSVsstarlFviAm7S7

like image 991
A T Avatar asked Jun 11 '14 02:06

A T


1 Answers

When the state changes, all the new state's views and those of any ancestor state will be loaded. So if you want view A to remain unchanged while view B changes to view C, then view A's state will have to be an ancestor of views B and C. So you need an intermediary (possibly abstract) state.

Here is a Plunker.

like image 62
dave walker Avatar answered Oct 16 '22 01:10

dave walker