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

fix(ngAnimate): throw an error if a callback is passed to animate met… #11854

Closed

Conversation

petebacondarwin
Copy link
Contributor

…hods

As of bf0f550 (released in 1.3.0) it is no longer
valid to pass a callback to the following functions: enter, move, leave, addClass,
removeClass, setClass and animate.

To prevent confusing error messages, this change asserts that this parameter is
not a function.

Closes #11826
Closes #11713

…hods

As of bf0f550 (released in 1.3.0) it is no longer
valid to pass a callback to the following functions: `enter`, `move`, `leave`, `addClass`,
`removeClass`, `setClass` and `animate`.

To prevent confusing error messages, this change asserts that this parameter is
not a function.

Closes angular#11826
Closes angular#11713
@Narretz
Copy link
Contributor

Narretz commented May 11, 2015

LGTM
Although for the record I prefer to not do anything here at all. It's a documented BC.

@petebacondarwin
Copy link
Contributor Author

Trouble is that not doing anything leads to a very confusing error, which is hard to track down to having left this callback in place.

One thing missing here is actually the error doc. I will add it.

@fullName Do not pass a callback to animate methods
@description

Since Angular 1.3, the methods of {@link ng.$animate} do not accept a callback as the last parameter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention that the last parameter now takes the option object?

@matsko
Copy link
Contributor

matsko commented May 12, 2015

@petebacondarwin make sure to retrofit both the assertion code and the docs so that it can be merged into the 1.3 branch as well.

@petebacondarwin
Copy link
Contributor Author

@matsko - by retrofit you mean backport?

@matsko
Copy link
Contributor

matsko commented May 12, 2015

Yessir

@matsko
Copy link
Contributor

matsko commented May 14, 2015

Landed as 9804867 and 0515614

@matsko matsko closed this May 14, 2015
@petebacondarwin petebacondarwin deleted the animate-no-callback branch November 24, 2016 09:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(bug) ngAnimate options.domOperation is not a function
3 participants