July 2017
Intermediate to advanced
454 pages
10h 1m
English
We can bypass the declarative binding to component properties and events using a template reference variable or by injecting the target component into the parent component via the ViewChild and ViewChildren property decorators. In both the scenarios, we get a reference to the target component and can assign its properties or invoke its methods programmatically. To demonstrate these capabilities in action, we will slightly alter the ChildComponent class from Example2 and ensure that the myText property has a default text set. This can be seen in the highlighted code snippet within the child.component.ts file found in the Example4 folder from the source code for this chapter:
... export ...
Read now
Unlock full access