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

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -