I would like to getting the latest value. There are 2 API. one is updatePhoneNo and another one is getPhoneValue. After I called updatePhoneNo API, the getPhoneValue is loaded and updated the latest value. But the html page is not update. How to solve it?
TS:
projects$: Observable<CustDetaill>;
ngOnInit() {
this.projects$ = this.custService.getPhoneValue(this.custno);
}
update(){
this.custService.updatePhoneNo(this.custphoneno).subscribe(
res => {
this.projects$.next(this.custphoneno);
});
}
HTML
{{(projects$ |async)?.phoneNo}}
getPhoneValueis loaded and something is updated. Otherwise we are only able to guess what the problem could be.projects$as an observable and not a subject? Usually it should not be possible to callnexton a plain observable. Nevertheless you aren't doing anything with the response. Are you sure thatthis.custphonenodoes contain the updated value?