I am trying to call a public function which is inside my directive from component by getting hold of the directive via viewchild like this
@ViewChild('myDirective') myDirective;
....
myDirective.nativeElement.myFunction();
But I get error that the myFunction does not exist. Is there a way to call a function which is iniside a directive?