【发布时间】:2017-05-16 20:31:34
【问题描述】:
我一直在使用 angular2 浏览 ngrx/store 的文档
https://github.com/ngrx/example-app
上面的示例应用程序暗示我应该使用以下方式访问商店的可观察成员:
counter: Observable<number>;
constructor(private store: Store<AppState>){
this.counter = store.select('counter');
}
使用字符串 'counter' 访问对象成员感觉与 TypeScript 是对立的。是否有一种类型安全的方式来访问商店成员?
【问题讨论】:
标签: angular typescript ngrx ngrx-store