angularjs - Angular UI-Router nested tabs, switch and switch back to where we left off -


please

  1. click on "left"
  2. "Link 2 "to expand
  3. Click" right "
  4. Click" Left "- link 2 is no longer expanded

    Q: How can the left tab "Remember" that was displaying "Link 2" when we tab away from it and then come back to it? (I also want to do this for the right tab)

    Please note that I do not want to hack the official angular (UI router, etc.) code by any means.

    Also, I like that Link 1 stands first by default when Left is displayed or selected (with the same default on the right). But can it be a subject for a different question?

    You can do it very easily.

    Set different states for each tab at the same level

    1) Register the $ stateChangeSuccess listener on $ rootScope . If the state .includes ("left") or .includes ("right") , then keep track of the destination status and its states.

    2) Change a $ state on the $ rootScope change listener. If the state is at .is ("left") or .is ("right") , then stop the transition directly on the tab position and then $ State. Go in the previously saved state / parameter for that tab.

    Look at my Yuri-Router fork which this applies. I call it "a deep state redirect"

    I have made a crap and my scope has scope for scope in the root by integrating the scope of the audience and the registry. Take a look:

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -