@ViewChild takes 2 arguments error 1

@ViewChild takes 2 arguments error

 @ViewChild(ChildDirective, {static: false}) Component

Here is what the above code is Doing:
1. We are importing the ChildDirective from the child.directive.ts file.
2. We are using the @ViewChild decorator to get the reference of the ChildDirective.
3. We are using the static property to tell Angular that we want to get the reference of the ChildDirective after the view has been initialized.
4. We are using the ChildDirective reference to call the sayHello() method.

Similar Posts