What Are Angular Standalone Components?
Components in Angular are the basic building blocks of any Angular Application. When we create any component, we need to declare it in the module where we are creating that component otherwise Angular will throw error.
Starting from Angular 14, we can create components which can exist independently without being part of any ngModule. These components are called standalone components.
Dawn of Standalone Components
Till Angular 16, if we create a component with the ng generate component command, it will generate a standard component. We had to use –standalone command to generate a standalone component. Starting from Angular 17, Angular generates standalone components by default. If we still want to create non-standalone components in Angular then we need to use –no-standalone flag.
Advantages Of Standalone Components
Here are some advantages of using standalone components in Angular.
Leave a Reply