【发布时间】:2018-06-14 11:36:01
【问题描述】:
我从 firebase 服务器分块接收数据,同时渲染该数据需要一个坚持 observable contains Array 的库。我不知何故无法将新数据块推送到 observable 包含的现有数据块数组中,
从数据服务中,我通过主题的下一个调用并尝试添加新的 calEvent
this.homeWorkerService.eventSubject.next(calEvent);
在组件中,我有以下代码
events$: Observable<Array<CalendarEvent<any>>>;
和ngOnInit,我正在向它提供数据
this.events$ = this.service.eventSubject.asObservable();
您能否建议我可以向已保存我的事件的 observable 添加一个新事件的任何方法。
PS:我正在使用this lib 来呈现日历并使用remoteDB 来呈现事件。
谢谢,
【问题讨论】:
标签: angular rxjs observable subject