Call child component method from parent class – Angular
You can do this by using @ViewChild for more info check this link With type selector child component @Component({ selector: ‘child-cmp’, template: ‘<p>child</p>’ }) class ChildCmp { doSomething() {} } parent component @Component({ selector: ‘some-cmp’, template: ‘<child-cmp></child-cmp>’, directives: [ChildCmp] }) class SomeCmp { @ViewChild(ChildCmp) child:ChildCmp; ngAfterViewInit() { // child is set this.child.doSomething(); } } With … Read more