-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nested ui-view error #2763
Comments
is Can you try switching to |
It worked with previous version I think. I changed this way and it works, I'll try more things later
|
if you can reproduce the error code in a plunker, I'd be happy to take a look |
I've also noticed this issue - would appreciate any thoughts: http://plnkr.co/edit/tYl0WK?p=preview Thanks! |
This started showing up in my application as well. It started when updating from 0.2.18 to 0.3. I'm not sure what causes it yet, but will post back here if I manage to figure it out. |
Hey, joining the gang. I am also experiencing this issue and I do and Any ideas? |
I downgraded to the previous legacy versiom for now - then it works again.
|
introduced by this commit fde64e1 |
@Luddinus @homerjam @MWallenberg @egantz I've figured out what's causing this bug; before 0.3.0 the I'll figure out how to fix this bug. In the meantime, can you explain why you'd create a nested ui-view like this?
This makes no sense to me. Also, the original bug report's state definition doesn't seem to match the reported HTML:
Can somebody explain what the intention is of this setup? |
Great thanks @christopherthielen. I realise this structure looks a bit weird but its a simplification of a setup I've used quite a few times. However I started doing this a couple of years ago so maybe its no longer necessary to do so. I'll try and dig out my original rationale from my memory. One use case is to provide a simple way to resolve app-wide dependencies - I can do this by adding them to an abstract parent state definition which uses the I think another reason it helps to do it like this is for when pre-rendering the app for SEO - its easier to ensure you have everything loaded as there is a distinct structure to follow. Aren't nested views pretty handy in general anyway (or is it specifically this setup that seems unusual)? Do you have any thoughts on a better solution? |
@homerjam nested views are certainly useful. The plunker's specific setup (a single template with a nested ui-view inside of an outer ui-view) is weird. Generally a template has one ui-view, or multiple sibling ui-views.
When a state's view fills in the "main" ui-view, the inner html is replaced by the new template (the "content" ui-view is then gone) and so the "content" view cannot be targeted anymore. On the other hand, if a state doesn't fill in the "main" ui-view, so it can instead fill the "content" ui-view, then what's the point of the "main" view? This makes sense to me:
This also makes sense to me:
|
@christopherthielen I understand - primarily I striped the plunker back to basics to demonstrate the issue. Your examples make more sense in a real world scenario however. Thanks again for looking into this. |
The `$uiView` element.data lifecycle is somewhat fragile. The Fill directive reads the inherited `$uiView` data to figure out which state the ui-view was created in. In a previous commit, the non-fill directive was setting the `$uiView` date earlier to hold the animation promises. This caused the fill directive to read the wrong state data, breaking some users' apps. BC-BREAK Users who were using `element.data('$uiView').$animEnter` or `$animLeave` should now use `element.data('$uiViewAnim').$animEnter` instead Closes #2763
The `$uiView` element.data lifecycle is somewhat fragile. The Fill directive reads the inherited `$uiView` data to figure out which state the ui-view was created in. In a previous commit, the non-fill directive was setting the `$uiView` date earlier to hold the animation promises. This caused the fill directive to read the wrong state data, breaking some users' apps. BC-BREAK Users who were using `element.data('$uiView').$animEnter` or `$animLeave` should now use `element.data('$uiViewAnim').$animEnter` instead Closes #2763 Manually merged/cherry picked from commit d3502f3
Hi.
I have nested view like this
And this routes
And I get this error: Cannot read property 'name' of undefined
at getUiViewName
I'm using 0.3 version...
What Am I missing?
The text was updated successfully, but these errors were encountered: