From the course: Learning the Angular CLI
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Solution: Generating services - Angular Tutorial
From the course: Learning the Angular CLI
Solution: Generating services
(upbeat music) - [Instructor] Suppose we are generating an API service. At your terminal, you will use the ng generate service command and then the name of the service, but we would like to place this in a services folder. So we'll go ahead and prepend services here. And just like that, we have a services folder created along with the API service and the spec file. An important thing to note is that by default, services are registered with the root injector, and so angular creates a single shared instance of the generator service across our application.
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.