I have an element set to display: none; height: 0px and I want to add classes to it that makes display: block; height: 200px; with a CSS transition on the height. The problem is the transition - for it to work, the element has to be display: block first before changing the height.
So $el.addClass("display-block full-height") doesn't show the transition, as it adds both classes at the same time.
This jQuery does work though:
$el.addClass("display-block");
$el.width(); // <-- Forces a browser redraw of the element before proceeding
$el.addClass("full-height");
What I'd like to know is how I get this working with AngularJS's ng-class ? It seems like the only way is to add both classes at the same time, which doesn't work as above. Is there a good solution, either a way that forces a redraw in the same way or something else?
I could do a custom directive if that's the only answer, but I'd prefer a better way if possible.