Reputation: 633
The problem is I want to assign a value on a observable type interface. But I don't know how to do that.
export interface LocalConsultationCachingModel {
cache: ConsultationModel[];
httpPromise: Observable<ConsultationModel[]>;
}
I want to assign on httpPromise: Observable<ConsultationModel[]>;
}
Upvotes: 0
Views: 166
Reputation: 2431
To set value to an observable you can just use of
operator from RxJS.
It'll emit your value then emits a complete notification.
let localConsultation : LocalConsultationCachingModel = {
cache: [...],
httpPromise: of([...])
}
Upvotes: 1