Posts

Showing posts from August, 2021

Api calling ionic4

import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core';   import { throwError } from 'rxjs'; import { map, catchError } from 'rxjs/operators';   constructor(private http: HttpClient) {       // development database     this.API_HOST= "";        }    OuterIdBreak(formdata) {           const reqHeader = new HttpHeaders();           reqHeader.append('Content-Type', 'application/json');       return this.http.post(`${this.API_HOST}/outbound/outeridbreak/`,formdata)       .pipe(map(res => res), catchError(this.errorHandler));     }  errorHandler(error: Response) {     console.log("RESULT:::", error);     return throwError(error);   }