Standalone Components (NgModule-optional)
Compare Standalone Components (NgModule-optional) with a common alternative (angle 6). How do you decide in a design review?
Answers use simple, clear English.
Audio N/AQuick interview answer
Baseline: Angular 15+ standalone components/directives/pipes declare imports directly. Angular 17+ new apps default standalone — NgModules optional for most apps.
Detailed answer
Baseline: Angular 15+ standalone components/directives/pipes declare imports directly. Angular 17+ new apps default standalone — NgModules optional for most apps. Prefer when pros dominate: Simpler mental model; better lazy loading boundaries.. Avoid when: Large legacy NgModule apps need incremental migration.. Core: Angular 15+ standalone components/directives/pipes declare imports directly. Angular 17+ new apps default standalone — NgModules optional for most apps. Real-time example: @Component({ standalone: true, imports: [RouterLink, CurrencyPipe] }) Pros: Simpler mental model; better lazy loading boundaries. Cons: Large legacy NgModule apps need incremental migration. Common mistakes: Forgetting to import CommonModule features / new control flow. Best practices: Migrate feature-by-feature; use schematic where available. Audience level: Architect.
Full explanation
Angular 15+ standalone components/directives/pipes declare imports directly. Angular 17+ new apps default standalone — NgModules optional for most apps.
Real example & use case
@Component({ standalone: true, imports: [RouterLink, CurrencyPipe] })
Pros & cons
Pros: Simpler mental model; better lazy loading boundaries. Cons: Large legacy NgModule apps need incremental migration.
Common mistakes
Forgetting to import CommonModule features / new control flow.
Best practices
Migrate feature-by-feature; use schematic where available.
Follow-up questions
Open one as its own read / solve / listen card