ui-router icon indicating copy to clipboard operation
ui-router copied to clipboard

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

Open rubenv opened this issue 12 years ago • 16 comments

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.

rubenv avatar Jan 20 '14 11:01 rubenv

'tis valid

timkindberg avatar Jan 20 '14 17:01 timkindberg

Yep, does not also for me.

lukanus avatar Jan 22 '14 13:01 lukanus

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

dlukez avatar Jan 23 '14 01:01 dlukez

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

jachenry avatar Jan 27 '14 22:01 jachenry

@dlukez The plunkr i made for https://github.com/angular-ui/ui-router/issues/829 doesn't contain ng-class. So it could be two separat issues. https://github.com/angular-ui/ui-router/issues/829 is a bit confusing, sorry. I want to reopen https://github.com/angular-ui/ui-router/issues/829.

bbshopadmin avatar Jan 29 '14 12:01 bbshopadmin

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

sloops77 avatar Feb 02 '14 22:02 sloops77

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.

kloy avatar Feb 10 '14 04:02 kloy

This is also related to #866.

gustavohenke avatar Feb 10 '14 12:02 gustavohenke

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...

dlukez avatar Feb 11 '14 02:02 dlukez

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.

lanceschi avatar Feb 11 '14 08:02 lanceschi

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.

dlukez avatar Feb 11 '14 09:02 dlukez

@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

lanceschi avatar Feb 11 '14 10:02 lanceschi

@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 avatar Feb 12 '14 23:02 dlukez

@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

dlukez avatar Feb 13 '14 02:02 dlukez

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

lanceschi avatar Feb 13 '14 08:02 lanceschi

Duplicate of #866 Sorry!

timkindberg avatar Feb 14 '14 06:02 timkindberg