I have the following container component
export class EventsComponent {
data$: Observable<Data[]> = this.store.select(data);
loading$: Observable<boolean> = this.store.select(loading);
}
And bind the observables via | async to the presentational component:
<app-presentational
[rowData]="data$ | async"
[loading]="loading$ | async"
...
export class PresentComponent {
@Input()
rowData: Data[];
@Input()
loading: boolean;
}
However, the TS compiler always complains that the async pipe may return null.
Update, this is the exact error i get
Type 'boolean | null' is not assignable to type 'boolean'.
Type 'null' is not assignable to type 'boolean'.ngtsc(2322)
So do I really have to change all my @Input() to this?
export class PresentComponent {
@Input()
rowData: Data[] | null;
@Input()
loading: boolean | null;
}