Angular 2 ViewChild

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Thanks for the video.
Just my thought based on Polymer/Web component experience, using @ViewChild looks little bit like breaking the encapsulation of component. I'd rather create a boolean flag property on both parent and child, button click on the parent sets the flag
, then parent flag passes to child flag, child component check if child flag gets updated then run clear().

<counter [flag]="flag"></counter>

ttma
Автор

I am trying to Invoke Child Component Method Defined in .ts ile from parent Component but it is giving me error plz any help!

ParentComponent class ParentComponent - inline template:6:0 caused by: Cannot read property 'MethodInChild' of undefined


As I am Calling Like:
/FROM PARENT
public void {

}

khizerrehan