I've implemented service for sharing the data between compoments:
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class DataService {
private dataSource = new BehaviorSubject(Object);
public currentData = this.dataSource.asObservable();
constructor() {}
changeData(data) {
this.dataSource.next(data);
}
}
Everything was working fine, until I've tried to build the project. Then I've got this error:
error TS4029: Public property 'currentData' of exported class has or is using name 'Observable' from external module "/rxjs/internal/Observable" but cannot be named.