Skip to content

Does not evaluate ng-class when combined with ui-view #786

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

Closed
rubenv opened this issue Jan 20, 2014 · 16 comments
Closed

Does not evaluate ng-class when combined with ui-view #786

rubenv opened this issue Jan 20, 2014 · 16 comments
Labels
Milestone

Comments

@rubenv
Copy link

rubenv commented Jan 20, 2014

This has been brought up before in #664 and a couple of other duplicates, but does not appear to be fixed: http://plnkr.co/edit/UoSC77d8cizGhBPsfYrr?p=preview

Putting ng-class on a tag with ui-view breaks the ng-class.

From #664, I'd assume that this is merged and working, yet as the plunker shows, it isn't.

@timkindberg
Copy link
Contributor

'tis valid

@lukanus
Copy link

lukanus commented Jan 22, 2014

Yep, does not also for me.

@dlukez
Copy link
Contributor

dlukez commented Jan 23, 2014

In the meantime you can use this version: https://github.com/dlukez/ui-router/blob/angular-1.2/release/angular-ui-router.js although it doesn't have any of the updates since 0.2.0 and it only works with 1.2. I intend on trying to write a fix for this in the next week or so since a few people are after this now

@nateabele nateabele reopened this Jan 23, 2014
@jachenry
Copy link

Experiencing same issues here. I'm hoping to use ng-class in order to change the animation based on previous and next state.

@bbshopadmin
Copy link

@dlukez The plunkr i made for #829 doesn't contain ng-class. So it could be two separat issues. #829 is a bit confusing, sorry. I want to reopen #829.

@sloops77
Copy link

sloops77 commented Feb 2, 2014

Thanks @dlukez - after an hour of banging my head found this issue and used your version

@kloy
Copy link

kloy commented Feb 10, 2014

I've been messing with this tonight and from what I can tell, ng-class/ng-show/ng-hide all do not work on the first state loaded. However, if you navigate, from then on ng-class and others begin to function as expected.

@gustavohenke
Copy link
Contributor

This is also related to #866.

@dlukez
Copy link
Contributor

dlukez commented Feb 11, 2014

Yep, it's a problem with compiling the ui-view element itself so a lot of other directives aren't working properly. It's strange how it works after a few state changes though...

@lanceschi
Copy link

I encountered the same behaviour in ui-view with Angular v1.2.12 and ui-router v0.2.8. Since in a section of my project I have to switch to a full height (height:100%) html document view the only viable option for me is by now to add & remove class to the ui-view element with jQuery. A fix would be really appreciated.

@dlukez
Copy link
Contributor

dlukez commented Feb 11, 2014

Or put it on a parent element. I think you can use the animation styles via a parent selector

Sent from my iPhone

On 11/02/2014, at 7:54 PM, lanceschi [email protected] wrote:

I encountered the same behaviour in ui-view with Angular v1.2.12 and ui-router v0.2.8. Since in a section of my project I have to switch to a full height (height:100%) html document view the only viable option for me is by now to add & remove class to the ui-view element with jQuery. A fix would be really appreciated.


Reply to this email directly or view it on GitHub.

@lanceschi
Copy link

@dlukez : can you give further details? Consider that for a full height html doc the ui-view height attribute should be modified to 100%. Thanks, Luca

@dlukez
Copy link
Contributor

dlukez commented Feb 12, 2014

@lanceschi Never mind, doesn't look like that works either! Another temporary workaround might be to write a directive that you put on the parent element, that sets a class on the child ui-view element using jqLite/jQuery.

@dlukez
Copy link
Contributor

dlukez commented Feb 13, 2014

@lanceschi The last solution I mentioned doesn't seem to work either, at least not with a simple implementation. May be best to just wait until a proper fix gets in master

@lanceschi
Copy link

@dlukez: thanks! I agree. For now the jQuery workaround does the trick, nevertheless a fix is needed and would be much appreciated.

@timkindberg
Copy link
Contributor

Duplicate of #866 Sorry!

@christopherthielen christopherthielen modified the milestones: 0.2.10, 1.5.0 Nov 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests