Which module should you import to use the HttpClient in an Angular application?
- @angular/common/http
- @angular/core
- @angular/forms
- @angular/router
To use the HttpClient in an Angular application, you should import the @angular/common/http module. This module provides the HttpClient service for making HTTP requests.
Loading...
Related Quiz
- Which providedIn value ensures that a service instance is shared across the entire application?
- You're building a layout component that should allow users to inject custom content for the header, sidebar, and main content area. What approach would you take to enable this functionality in the layout component?
- In NgRx, what is responsible for specifying how state changes in response to actions?
- In Angular's hierarchical dependency injection, the _____ is the first injector that is checked when trying to resolve a service dependency.
- You have a shared service that maintains user settings. You notice that different parts of the application have different instances of this service. What could be a possible reason?