July 2018
Intermediate to advanced
420 pages
8h 46m
English
Angular services are used to handle data; it can be internal data (from one component to another) or something external, such as communicating with an API endpoint. Almost all frontend applications with JavaScript frameworks use this technique. In Angular, we call this a service, and we use some modules built into the Angular framework to complete the task: HttpClient and HttpClientModule.
Let's look at how the Angular CLI can help us:
ng g service beers/beers
The previous command will generate two new files in the beers folder:
beers.service.spec.ts and beers.service.ts.
Read now
Unlock full access