Which Angular CLI command is used to generate a new service?
- ng create service
- ng generate service
- ng make service
- ng new service
To generate a new service in an Angular application, you should use the ng generate service command. This command creates the service file, sets up the necessary imports, and registers the service with the Angular dependency injection system.
Loading...
Related Quiz
- Which command in Angular CLI generates a new service?
- In NgRx, which entity describes the type and payload of an action that represents changes in the state?
- What is the behavior of the ViewEncapsulation.None mode?
- You are tasked with implementing a feature where, upon clicking a button, the user should be redirected to the home page. Which method or feature of Angular's router would you utilize?
- In the context of Reactive Forms, which property indicates the current value of the FormControl, FormGroup, or FormArray instance?