Reputation: 622
I am using BehaviorSubject for the communication between components. But when I try to subscribe, it is throwing an error as "Property 'subscribe' does not exist on type 'BehaviorSubject'."
private dictionarySubject: BehaviorSubject<Dictionary> = new BehaviorSubject<Dictionary>(null);
In below code it is throwing an error
public subscribe(callback: (dicoes: Dictionary) => void) {
this.dictionarySubject
.subscribe((dico) => {
if (dico === null) {
return;
}
callback(dico);
});
}
Note : I have just migrated my angular application from version 5 to 6. Earlier it was working fine.
Upvotes: 0
Views: 27