In the parent component, I am dispatching an action and hoping to receive the dispatched array in the child component. To achieve this, I have implemented the following code:
export class ListComponent implements OnInit {
@Select(ProductState.getProductDetails) listProduct$: Observable<Product>;
constructor() {
//Attempting to access the dispatched array using the following
const list = this.listProduct$;
console.log('The array content is ', list);
}
}
The list$
variable should ideally return an array as I intend to iterate through its elements and perform data filtering.
However, despite my efforts, I have not been able to observe the correct dispatch of data from the parent component in the logs, and consequently, I have been unable to retrieve or modify it in the child component.