Angular & Signals (283 Qs)•Part 10: Reactive Forms, Standalone Components, Signals & NgRx (256 - 283)
What is standalone component?
A standalone component is a type of component which is not part of any Angular module. It provides a simplified way to build Angular applications.
Practical Code Example
typescript
// Standalone Component (Angular 14+ standard):
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
@Component({
selector: 'app-user',
standalone: true,
imports: [CommonModule],
template: `<p>Standalone: No NgModule required!</p>`
})
export class UserComponent {}