typescript - How to implement OnInit and OnChanges on same component with type safety -
one of things typescript type safety , use consistently.
typescript not support multiple inheritance, how can extend angular 2 component class oninit
, onchanges
@ same time?
i know works without declaring inheritance code without squiggly lines.
oninit
, onchanges
not classes interfaces, components don't inherit implement interfaces.
as class can implements many interfaces needs, there no problem implementing both oninit
, onchanges
interfaces on same component.
for example:
class foocomponent implements oninit, onchanges { }
for more information, have @ angular lifecycle hooks guide.
Comments
Post a Comment