1// you can try like this, here you want to get the data from the parent component to child component, Here your parent component is ParentComponent and child component is app-child so here for getting the data from parent to child we can use ngOnChanges(changes: SimpleChanges)
2
3// ParentComponent.html
4
5<app-child
6[data]="data"
7(filterEmmiter)="filter($event)">
8</app-child>
9// child.component.ts
10
11
12import {Component, OnChanges, SimpleChanges, Input} from '@angular/core';
13
14class Child implements OnInit, OnChanges {
15
16 @Input() Data: any; // here is the data variable which we are getting from the parent
17
18 constructor() {}
19
20 ngOnchanges(changes: SimpleChanges) {
21 console.log(changes); // here you will get the data from parent once the input param is change
22 }
23
24}
25
26