From the course: Angular Essential Training
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Angular service classes - Angular Tutorial
From the course: Angular Essential Training
Angular service classes
- [Instructor] Earlier in this course, we looked at the injectable decorator and how to use it to build Angular services. In this video, we'll look at one way to write a service class. I opened our project here in a GitHub codespace. I talked about why we use codespaces earlier in this course, so for now, just think of them as an easy way to share and write code without installing anything on your local machine. Let's take a look at our custom API service. I'll go to the source folder, open up the app folder, services, and click on API dot service dot TS to open the file. Always use the service dot TS ending for your custom service files. The Angular CLI tool does this for you when you generate new services using the NG generate service command. Also, keep in mind that this is just one way to organize the files in your code base. Services can live anywhere you need them under the source directory. We export the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Overview of Angular pipes2m 11s
-
(Locked)
Using built-in Angular pipes4m 54s
-
(Locked)
Using custom Angular pipes4m 39s
-
(Locked)
Angular services and the injectable decorator2m 54s
-
(Locked)
Angular service classes5m 43s
-
(Locked)
Angular directive decorator2m 45s
-
(Locked)
Angular directive classes4m 17s
-
(Locked)
-
-
-
-
-