Performance: HttpClientModule setup
MEDIUM IMPACT
This affects the initial bundle size and network request efficiency when making HTTP calls in Angular apps.
import { HttpClientModule } from '@angular/common/http'; @NgModule({ imports: [HttpClientModule], }) export class AppModule {}
import { HttpClientModule } from '@angular/common/http'; @NgModule({ imports: [HttpClientModule, HttpClientModule], }) export class AppModule {}
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Multiple imports of HttpClientModule | 0 (no DOM impact) | 0 | 0 | [X] Bad |
| Single import of HttpClientModule in root module | 0 (no DOM impact) | 0 | 0 | [OK] Good |