christopherthielen / ui-router-extras

THIS PROJECT IS NO LONGER MAINTAINED -- Extras for UI-Router for AngularJS. Sticky States (a.k.a. parallel states), Deep State Redirect (for tab-like navigation), Future States (async state definition)
http://christopherthielen.github.io/ui-router-extras/
MIT License
917 stars 211 forks source link

Issue with sticky states replacing parent view #353

Closed davecranwell closed 7 years ago

davecranwell commented 7 years ago

http://plnkr.co/edit/FZj3bMlFPNtSTn0pNr9d?p=preview

I'm pretty sure this is something obvious I'm missing, but I can't seem to get this to work.

I've got a named view, in which I load more views which I want to be sticky, but swapping to those views only seems to override the parent.

What have I done wrong here?

bvallambhotla commented 7 years ago

Seems, you configured the child routes without a parent.

.state('newViewTest1') instead of .state('test.newViewTest1')

Here is the updated plnkr: http://plnkr.co/edit/bh1zJU?p=preview

Hope this is what you are trying to do and this helps.

davecranwell commented 7 years ago

update: Working! It seems all I was missing was an '@' in my named view object, to instruct router about where the view should be found.

Thanks for your reply. It's clear to me now my reduced case was not actually representative of what I was trying to achieve.

I've updated the plnkr from before.

In reality the situation is that I have a sideView as a sibling of my mainView, at the root of the app DOM, which modules can choose to use how they wish.

My intent is that I can have multiple routing configurations e.g one per module, that can optionally add content into the 'sideView' without requiring URLs for those states. The 'sideView' is an unimportant pop-out which should not require URL/location changes, but should be accessible by any module I choose to bolt on.

Have I just misunderstood what Sticky states can accomplish here? Is this achievable without them?