-
Notifications
You must be signed in to change notification settings - Fork 3k
ui-view incompatible with ng-class - ALL ng-class-based animations broken - 0.2.8 & 1.2.11 #866
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
Comments
+1 for fixing this. Also, it seems that ui-view is not playing well with other Angular directives such as ng-show: #867 |
I'd like to confirm this bug, even with my UI-Router version v0.2.7 and Angular version v1.2.4. <div ui-view ng-show="false"> I am assuming the |
I'm also facing the same problem and waiting for the fix. |
@kumarharsh could you comment that on #867? |
Funny, I had posted there earlier, but I believe this issue hits the core of it, and I presumed #867 would be closed in favour of this, given that there is only one maintainer of the project for now... |
@arush Thanks for staying on top of the issue. I'll try to find some time in the next day or two to port over the DOM-handling code from |
This doesn't solve the problem, but does provide a fairly easy temporary work around. Just thought I'd provide it for anyone who also encounters this problem. https://gist.github.com/dremonkey/9082268#file-ui-view-animate-js |
I'd like to point out that a ui-view inside an ng-if block won't work anymore |
Any progress on this issue? |
This is fixed in #858 - It should be released soon. |
http://plnkr.co/edit/JOP0QqRCc3dL1eMzSq13?p=preview updated plunker to show that it is fixed. I've referenced a version of ui-router that I built with my changes. |
Closing. Please reopen if you believe it's not fixed :). |
This has been giving me a headache for the past day or so. This is a modified version of the previous plunker. Am I doing something wrong or is this a side effect of the previous issue? |
+1 I have the same issue with $state.go() too! |
I'm on Angular 1.3.5 & ui-router 0.2.13 |
+1 same issue Angular 1.3.2 & ui-router 0.2.13 I'm trying to update ng-class="isSelected" in ng-repeat inside a ui-view |
Weirdly ng-class works ok if i don't navigate directly to the route via a url. Here are my states:
If I navigate to app via: http://localhost:3000/#/console or via ng-class inside list won't bind If I goto Very weird behaviour. |
+1, this has been wrecking my head too! Using angular 1.3.8 and ui-router 0.2.13. |
Same as @alexstanbury |
+1 |
+1 |
3 similar comments
+1 |
+1 |
+1 |
Still not working. Any updates? |
+1 |
+1 |
We found a solution for this problem, pretty simple after all: Instead of :
put:
and in the CSS just target the direct childs instead of element :
etc. |
That doesn't fix the underlying problem though |
BTW, I have the same problem with safari on mac and ios, using ng-view and ng-animate. |
I'm having a problem styling the html element background image. I only want the html background image to show up on a specific state, but once I tamper with the html style it is used across all of the states... Anyone have a solution or is this impossible??? |
can any one please tell me the solution for above problem without changing the ui router |
+1 |
This issue has been automatically marked as stale because it has not had This does not mean that the issue is invalid. Valid issues Thank you for your contributions. |
I've been following #320 for a few months, and although it was closed, unfortunately my comment on ng-class based animations was skipped over. I was hoping this was resolved with 0.2.8 but it is not.
CSS classes managed by ng-class conflict with ALL ui-view animations. This means you CANNOT use ng-class on a ui-view
The implications are pretty huge:
Expected results (working with ng-view)
<div ng-view class="firstAnimationClass ng-leave" ng-class="this.variable">
<div ng-view class="firstAnimationClass ng-enter" ng-class="this.variable">
or
<div ng-view class="secondAnimationClass ng-leave" ng-class="this.variable">
<div ng-view class="secondAnimationClass ng-enter" ng-class="this.variable">
(firstAnimationClass/secondAnimationClass is assigned by ng-class="this.variable")
No matter how the dynamic class changes, both the entering and leaving view will have the same animation class
Actual results (using ui-view)
<div ui-view class="firstAnimationClass ng-leave" ng-class="this.variable">
<div ui-view class="secondAnimationClass ng-enter" ng-class="this.variable">
As soon as ng-class changes, the animation classes are out of sync and never get back in sync.
This situation should NEVER arise.
Code to reproduce
I have put together 2 plunkrs that are identical, except the first uses angular 1.2 ng-view, and the second uses ui-router/angular-1.2
working in ngRoute
http://plnkr.co/edit/MLsgJiYXJ4EQ7OnmUQWB?p=preview
broken in uiView
uiView: http://plnkr.co/edit/GYYKkBre9oZ4Yl2rcKdZ?p=preview
These should behave identically, it is the same code. But you will quickly see how animation classes get out of sync.
@nateabele you'll remember my previous examples when I initially raised this, and above I've updated all the libraries 1.2.11 and 0.2.8
FYI I also recommend we close #862 in favour of this, as I believe it is the same bug (but a vague explanation)
The text was updated successfully, but these errors were encountered: