Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

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

Closed
intellix opened this issue Jun 15, 2015 · 2 comments
Closed

Comments

@intellix
Copy link
Contributor

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
Copy link
Contributor

Narretz commented Jun 20, 2015

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?

@Narretz Narretz assigned matsko and unassigned Narretz Jun 20, 2015
@petebacondarwin petebacondarwin modified the milestones: 1.4.2, 1.4.3 Jul 6, 2015
matsko added a commit to matsko/angular.js that referenced this issue Jul 14, 2015
…s provided

`$animateCss` is a fan of transition animations, but it turns out that
if only a keyframeStyle is provided into the animation upon constrution
then it will quit because it assumes that nothing will be animated
(since no classes or styles are being applied). This patch ensures that
a keyframe style can solely be applied to an animation triggered with
`$animateCss`.

```js
// this will now work as expected
$animateCss(element, { keyframeStyle: '1s rotate' }).start();
```

Closes angular#12124
@matsko
Copy link
Contributor

matsko commented Jul 14, 2015

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

#12340

matsko added a commit to matsko/angular.js that referenced this issue Jul 14, 2015
…s provided

`$animateCss` is a fan of transition animations, but it turns out that
if only a keyframeStyle is provided into the animation upon constrution
then it will quit because it assumes that nothing will be animated
(since no classes or styles are being applied). This patch ensures that
a keyframe style can solely be applied to an animation triggered with
`$animateCss`.

```js
// this will now work as expected
$animateCss(element, { keyframeStyle: '1s rotate' }).start();
```

Closes angular#12124
Closes angular#12340
@matsko matsko closed this as completed in 97d79ee Jul 14, 2015
netman92 pushed a commit to netman92/angular.js that referenced this issue Aug 8, 2015
…s provided

`$animateCss` is a fan of transition animations, but it turns out that
if only a keyframeStyle is provided into the animation upon constrution
then it will quit because it assumes that nothing will be animated
(since no classes or styles are being applied). This patch ensures that
a keyframe style can solely be applied to an animation triggered with
`$animateCss`.

```js
// this will now work as expected
$animateCss(element, { keyframeStyle: '1s rotate' }).start();
```

Closes angular#12124
Closes angular#12340
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants