Which command in Angular CLI generates a new service?
- ng add service
- ng create service
- ng generate service
- ng new service
The correct command for generating a new service in Angular CLI is ng generate service. Services are used to encapsulate and share logic and data across different parts of your Angular application.
Loading...
Related Quiz
- If a parent component needs to send data to a child component, which property decorator should be used?
- Which directive in Angular is used to add or remove an element from the DOM based on a condition?
- For a form control that has both synchronous and asynchronous validators, how does Angular handle validation?
- When the ViewEncapsulation.Emulated mode is used, Angular adds unique ________ to styles to achieve scoped styling.
- The HttpClient method used to send data to the server as a POST request is ________.