{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/13339","labels_url":"https://api.github.com/repos/angular/angular.js/issues/13339/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/13339/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/13339/events","html_url":"https://github.com/angular/angular.js/issues/13339","id":117607745,"number":13339,"title":"ngAnimate doesn't remove class which is animating","user":{"login":"maxaon","id":3187207,"avatar_url":"https://avatars.githubusercontent.com/u/3187207?v=3","gravatar_id":"","url":"https://api.github.com/users/maxaon","html_url":"https://github.com/maxaon","followers_url":"https://api.github.com/users/maxaon/followers","following_url":"https://api.github.com/users/maxaon/following{/other_user}","gists_url":"https://api.github.com/users/maxaon/gists{/gist_id}","starred_url":"https://api.github.com/users/maxaon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxaon/subscriptions","organizations_url":"https://api.github.com/users/maxaon/orgs","repos_url":"https://api.github.com/users/maxaon/repos","events_url":"https://api.github.com/users/maxaon/events{/privacy}","received_events_url":"https://api.github.com/users/maxaon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-18T15:12:50Z","updated_at":"2015-11-19T13:37:45Z","closed_at":null,"body":"Removing class which is currently animating doesn't work. \r\n\r\n**Angular Version:** since 1.4.5 till 1.5.0-build.4389\r\n**Browser:** Any\r\n**Reproducable:** almost always (sometimes doesn't reproduce under debugging)\r\n**Operating system:** Any\r\n\r\n**Detail**\r\nFor the example of bug see [plunker](http://plnkr.co/edit/BsWymZhJ35Ljs9EYSu1Z?p=preview)\r\nBy normal it should not has class `pending` at the end.\r\n\r\nWhat happens:\r\n1. Adding class `pending`\r\n2. NgModel adds class `ng-valid-required` (it's joining animation and applies preparation class)\r\n3. Timeout is fullfilled\r\n4. Trying to remove class. \r\nInside ngAnimations it checks that element has animations, it cannot be cancelled and skipped, so it's try to join animation. Because element is in running state it tries to normalize options.  Function normalize options cannot find class  `pending` and remove it from options. Remove animation exits as invalid.\r\n5. Class `pending` added to dom node\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/158058743","html_url":"https://github.com/angular/angular.js/issues/13339#issuecomment-158058743","issue_url":"https://api.github.com/repos/angular/angular.js/issues/13339","id":158058743,"user":{"login":"Narretz","id":1153097,"avatar_url":"https://avatars.githubusercontent.com/u/1153097?v=3","gravatar_id":"","url":"https://api.github.com/users/Narretz","html_url":"https://github.com/Narretz","followers_url":"https://api.github.com/users/Narretz/followers","following_url":"https://api.github.com/users/Narretz/following{/other_user}","gists_url":"https://api.github.com/users/Narretz/gists{/gist_id}","starred_url":"https://api.github.com/users/Narretz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narretz/subscriptions","organizations_url":"https://api.github.com/users/Narretz/orgs","repos_url":"https://api.github.com/users/Narretz/repos","events_url":"https://api.github.com/users/Narretz/events{/privacy}","received_events_url":"https://api.github.com/users/Narretz/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T13:37:45Z","updated_at":"2015-11-19T13:37:45Z","body":"Very interesting. Is the use of `attrs.$addClass` necessary? You could otherwise simply use `element.addClass` and the bug does not appear: http://plnkr.co/edit/k8KBsZ3hlXgC0QsL2eAB?p=preview"}}