Standalone components were introduced in Angular 14 and should be used instead of modules for every new component you create.
There is a number of advantages of using standalone components over modules as they:
To make a component standalone, set standalone: true
@Component({standalone: true,selector: "my-component",imports: [FooComponent],template: `...<foo-component></foo-component>`,})export class MyComponent {// component logic}