I am new in angular. My Project is in angular5 and I am using a web API created in PHP. My WebApi gives response in postman but not from angular. I am using HttpClient to post request
export class GalleryComponent implements OnInit {
private apiUrl = 'http://localhost:8080/fullpath';
private response;
private data=[];
constructor(private http: HttpClient) {
this.response =this.getCategory();
}
getCategory (): Observable<any> {
return this.http.post(this.apiUrl,{});
}
ngOnInit() {
console.log(this.response);
}
}
My console Returns
What I have to do to get proper response from API?