When running the code snippet provided, the result displayed is [object object]
instead of the expected [{a,b},{b,c}]
.
// Service
bData : BehaviorSubject<any[]> = new BehaviorSubject<any[]>([]);
bDataSubject = this.bData.asObservable();
// Component:
data = [{a,b},{b,c}];
this.service.bData.next((this.data));
this.service.bData.subscribe(value =>
console.log("value changed: " + value)
);