Answer the question
In order to leave comments, you need to log in
Angular 8. Why GET requests fail?
Any http request through Angular's HttpClient throws an error.
Everything is written, as in the documentation for HttpClient, requests through a separate Angular service, subscribe in the component, output to the console there.
Service code where requests:
getRequest() {
return this.http.get<any>("[Любой url]");
}
this.service.getRequest.subscribe(
data => {
console.log(data);
},
error => {
console.log(error);
}
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question