Angular 4 - rxjs BehaviorSubject usage in Service
问题 My Service code looks like below - DataService @Injectable() export class DataService { ... private serviceRequestDtoSource = new BehaviorSubject<ServiceRequestDto>(null); serviceRequestDto$ = this.serviceRequestDtoSource.asObservable(); ... getAccountInfo(serviceRequestDto : ServiceRequestDto){ let body = JSON.stringify(serviceRequestDto); let headers = new Headers({ 'Content-Type': 'application/json' }); let options = new RequestOptions({ headers: headers }); console.log("In data service