在父组件上,我正在调度一个动作,我愿意在子组件上获取调度的数组,为此我正在执行以下操作:
export class ListComponent implements OnInit {
@Select(ProductState.getProductDetails) listProduct$: Observable<Product>;
constructor() {
//Can't get the dispatched array using the following
const list = this.listProduct$;
console.log('The array content is ',list);
}
}
list$
通常应该返回一个数组,因为我愿意对其元素运行 for 循环并过滤一些数据。
到目前为止,我无法在日志中看到数据从父组件正确分派,但我无法在子组件上获取/修改它。