Componentsintermediate
Standalone Components
Explain how standalone components remove the need for NgModules and how they became the default in modern Angular.
Standalone components let a component declare its own dependencies directly via an imports array instead of being registered inside an NgModule. This was Angular's answer to years of feedback that NgModules added ceremony and indirection for very little benefit in most applications, especially compared to how React, Vue, and Svelte let you just import what you need.
It's the difference between packing every ingredient for a recipe into a shared pantry that the whole restaurant fights over (NgModules) versus each chef keeping the specific ingredients they need right at their own station (standalone).
Key Concepts
1
Interviewers care about this because since Angular 17, ng generate component produces standalone components by default, and Angular 19 removed the standalone: true flag requirement entirely (it's implied). Knowing this history signals you're current with the ecosystem rather than only familiar with older NgModule-based tutorials.
ng generate componentstandalone: true
2
Under the hood, a standalone component's imports array can include other standalone components, directives, pipes, or entire NgModules for backward compatibility, meaning standalone and NgModule-based code can interoperate during a migration. The bootstrapApplication() function replaces platformBrowserDynamic().bootstrapModule() as the entry point for a fully standalone app, and providers that used to live in AppModule now go into bootstrapApplication's providers array or ApplicationConfig.
importsbootstrapApplication()platformBrowserDynamic().bootstrapModule()AppModulebootstrapApplication
3
The interview-relevant trade-off is mostly about migration: existing large codebases with deep NgModule hierarchies (especially ones relying on forRoot()/forChild() patterns from libraries) require careful, incremental migration rather than a rewrite, and Angular's schematics (ng generate @angular/core:standalone) automate much of that.
forRoot()forChild()ng generate @angular/core:standalone