December 2017
Beginner
372 pages
10h 32m
English
As we see on the previous page Angular CLI returned a warning when we generated the service. The warning states that "Service is generated but not provided, it must be provided to be used" which implies that the service we created is not referenced in any module and hence Angular may not be able to find it at runtime.
In Angular, we need to refer the service we create to either a component or a module to be able to access and use them. The Angular CLI does not know where you want to provide the said service; hence the warning message.
The module option is used to inform the CLI where to add the service reference, so if you want to add the service to the app module, we will add the following flag:
ng generate service trello.service ...
Read now
Unlock full access