Want to learn Angular? In this video, "Learn Angular: Angular Web Services with HttpClient", you'll learn how to Angular web services with HTTPClient.
In order to communicate with web services in Angular, it is best to use the HttpClient. The HttpClient has a number of benefits such as testability, strongly typed request and response objects, Observable APIs, and error handling.
The first step to using the HttpClient is to modify the imports section of your module to include the HttpClientModule. Then, by using dependency injection, inject the HttpClient into the constructor of your service. Next, provide a web service URI to the get function.
this.http.get(webServiceUri);
Make sure to provide an object type in the get function's generic parameter.
The http.get function returns an Observable which let's you subscribe to the web request and be notified when the result has returned.
http.get(uri).subscribe(data =-- this.myProperty = data)
You can use Operators to perform operations on the result and handle errors. By using the pipe function, you can chain together multiple Operators. For example; to handle errors use the catchError operator like this:
http.get(uri).pipe(catchError(this.handleErrors))
handleErrors(error: HttpErrorResponse){
return throwError(error.message);
}
To read more about the HttpClient and better understand Observables and Operators, please read the Angular documentation: https://angular.io/guide/http
"Desktop to Web: A WPF Developers Guide to Learning Angular" is a video tutorial series that will help you take your WPF and WinForms desktop coding skill to the web with Angular. This series will help you understand how your current desktop skills map directly to concepts in Angular to make your learning path to the web as easy and painless as possible.
During each video in this series I will be giving away a one year subscription to Infragistics Ultimate valued at $1,995 USD. Simply subscribe to my channel, like the video, and leave a comment to be entered. Winners are announced in the next video in the series.
Official contest rules: http://brianlagunas.com/desktop-to-we...
The Prize: https://www.infragistics.com/products...
Follow Me:
Twitter: / brianlagunas
Twitch: / brianlagunas
Blog: http://brianlagunas.com
GitHub: https://github.com/brianlagunas
My Prism Project:
Prism Library: http://prismlibrary.github.io/
Become a Patron: / prismlibrary
En esta página del sitio puede ver el video en línea Learn Angular: Angular Web Services with HttpClient de Duración hora minuto segunda en buena calidad , que subió el usuario Brian Lagunas 08 agosto 2019, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 4,078 veces y le gustó 64 a los espectadores. Disfruta viendo!