-
Notifications
You must be signed in to change notification settings - Fork 232
Remove the need to keep implementing life cycle classes on subclasses #19
Comments
So you definitely want the interface in Dart because you'll get static checks if you forget to implement the ngOnDestroy method and you can make a clean (component as OnDestroy).ngOnDestroy() call. The one limitation today (we're working on it) is that if you inherit from a class that implements OnDestroy the lifecycle event is not called. |
Blocked by #48 |
Just an update: Still blocked by #48 (same issue). Early work is getting us towards this. |
This is now planned for the 4.0 release. |
Good news, this is now unblocked and we are testing a fix internally. |
Blocked by #404. |
Closing since it technically has landed. It will be available in |
This seems not to work if there's an extra class in between the component implementing life cycle classes and the class actually instantiated.
ngOnInit call is not generated for TheComponent.
Now ngOnInit call is generated for TheComponent. |
Currently you can extend existing components or directives, but in order for the life cycle hooks to trigger, the subclass must always copy the 'implements' list.
i.e.
Bar need to declare that it imlpements OnDestroy, or the ngOnDestroy method is not called.
I've always assumed that this was a downside from the compile-from-TS solution, is there any chance this can be adjusted? (ending up with the Baz class instead of the Bar class)
The text was updated successfully, but these errors were encountered: