angular / angular.js

AngularJS - HTML enhanced for web apps!
https://angularjs.org
MIT License
58.8k stars 27.49k forks source link

ngAnimate - Providing only keyframe/keyframeStyles to $animateCss does nothing #12124

Closed intellix closed 9 years ago

intellix commented 9 years ago

After realising that keyframe should actually be keyframeStyles for $animateCss I see that passing keyframeStyles alone will decide that there's nothing to do and return: closeAndReturnNoopAnimator().

To get around this I have to do something like:

$animateCss(ele, { 
  keyframeStyles: '1s my-anim ease',
  addClass: 'meh'
});
Narretz commented 9 years ago

The comment before the return in question says:

      // there is no way we can trigger an animation since no styles and
      // no classes are being applied which would then trigger a transition

(https://github.com/angular/angular.js/blob/master/src/ngAnimate/animateCss.js#L560)

If that is correct, the documention needs to be updated. @matsko do you know if that is the case?

matsko commented 9 years ago

Excellent find. This PR will fix this issue and we should have it ready for tomorrow's release (1.4.3):

https://github.com/angular/angular.js/issues/12340