1
5
HVHARIGOVIND VALSAKUMAR
AngularRXJSObservable
HGV Public CookbookRecipe for calling Get API endpoint
import { HttpHeaders, HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map, tap } from 'rxjs/operators';
constructor(private http: HttpClient) {}
GetAllSaved(): Observable<Array[]> {
return this.http
.get<Array<string>>('Your API URL')
.pipe(
map((response) => {
const jsonResult = JSON.parse(JSON.stringify(response));
return jsonResult;
})
);
}