score:0

Accepted answer

dashboardcardcomponent.ts

 //@input() card: any;
 @input() card$: observable<any>;
 

tap the observable to fetch data and subsequent changes

ngoninit() {
//if (this.card.type === 'line') {
//  this.linechartdata.push(this.card.value);
//}
this.card$.pipe(
 tap(data=>this.linechartdata.push(data.value))
 .subscribe() // either unsubscribe in ondestroy or use async pipe in html
 }

in your calling component generalstatscomponent

subject card = new subject() // from rsjx
card.next( ... data... ) // data fetched from api or your selection logic 

generalstatscomponent.html

<app-dashboard-card [card$]='card' ...>

above is just a pseudo code .. syntax needs to be reviewed.


Related Query

More Query from same tag