【发布时间】:2018-07-20 22:48:06
【问题描述】:
当我使用 angular routerLink 导航时,以下代码可以正常工作。
但是,如果我刷新页面,我会得到 undefined 值。
this.sub = this._route.fragment.subscribe((collectionKey: string) => {
this.store.dispatch( new actions.Select(collectionKey));
const col = this.store.select(fromStore.getSelectedCollection);
col.subscribe(collection => this.collection = collection);
console.log(this.collection)
});
有没有办法解决这个问题?
【问题讨论】:
-
iMO 嵌套订阅是个定时炸弹
-
你能详细说明一下吗?