Angular 2+ :@view Child
ANGULAR2 @view Child Viewchild offers one way interaction fro . m parent to child. There is no return mes . sage or output from child when ViewChild is used. ViewChild is used for component to template communication. It is used to ref . erence a directive or element or component. Example let element = document.getElementById('elementId'); @ViewChild('elementV . ariable') elementRef; // template reference variable @ViewChild(NgModel) filterInput: NgModel; // a ngular directive - on template would look like: <input [(ngModel)]='listfilter'> @ViewChild(Pare . ntComponent) Parent: (ParentComponent) // child com . ponent - on template would look like: <child-component[input1]='some.input'> Detailed Example We ha . ve a DataListC . omponent that shows som . e information. DataListComponent has PagerComponent as it's child. When user . makes a search on DataListComponent, it gets a data from a servic . e and ask Pag...