September 2017
Intermediate to advanced
450 pages
11h 24m
English
There are many types of content you can scaffold out with Angular-CLI's generators. Let's take a look at how we can generate new services in our Angular application using Angular-CLI's generate command.
Generating new services with Angular-CLI is very similar to generating components, but with the following few key differences:
ng g service my-storeinstalling servicecreate src/app/my-store.service.spec.tscreate src/app/my-store.service.tsWARNING Service is generated but not provided, it must be provided to be used
Scaffolding a new service generates fewer files than a component and also nests the service at the root of our application directory by default instead of nesting it in its own namespace. The warning that is presented ...
Read now
Unlock full access