Standalone Components (NgModule-optional)
Go deep on Standalone Components (NgModule-optional): edge cases, scalability limits, and how you'd evolve the solution over 2 years.
Answers use simple, clear English.
Quick interview answer
Angular 15+ standalone components/directives/pipes declare imports directly. Angular 17+ new apps default standalone — NgModules optional for most apps.
Detailed answer
Angular 15+ standalone components/directives/pipes declare imports directly. Angular 17+ new apps default standalone — NgModules optional for most apps. Scale limits often appear in: Large legacy NgModule apps need incremental migration.. Evolution levers: Migrate feature-by-feature; use schematic where available.. Anchor example: @Component({ standalone: true, imports: [RouterLink, CurrencyPipe] }) 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: Tech Lead.
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