-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(md-spinner): animation not being cleaned up when used with AoT #1838
Conversation
Fixes the `md-spinner` animation interval not being cleaned up when the app has been compiled through the AoT. This is due to the the fact that the `ngOnDestroy` handler is in the base `MdProgressCircle` class. Fixes angular#1283.
// The `ngOnDestroy` from `MdProgressCircle` should be called explicitly, because | ||
// in certain cases Angular won't call it (e.g. when using AoT and in unit tests). | ||
super.ngOnDestroy(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tbosch Is this the intended behavior for generated code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to note that this happens in the unit tests as well. I'm pretty sure that they're not using AoT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly yes, see angular/angular#11606
LGTM |
Similarly to angular#1838, the `tab-link` destroy handler may not be called in certain situations, because it is being inherited from the MdRipple class. This PR explicitly calls the destroy handler.
* Similarly to angular#1838, the `tab-link` destroy handler may not be called in certain situations, because it is being inherited from the MdRipple class. This PR explicitly calls the destroy handler. * Adds a unit test to make sure that the ripples are being cleaned up properly.
* Similarly to #1838, the `tab-link` destroy handler may not be called in certain situations, because it is being inherited from the MdRipple class. This PR explicitly calls the destroy handler. * Adds a unit test to make sure that the ripples are being cleaned up properly.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes the
md-spinner
animation interval not being cleaned up when the app has been compiled through the AoT.This is due to the the fact that the
ngOnDestroy
handler is in the baseMdProgressCircle
class.Fixes #1283.
Note: At some point it may be better to reorganize the component so we have the following setup:
This should avoid having to refer to the
super
class for things like cleaning up the animation.