Every Angular component requires a TypeScript class for behavior, an HTML template controlling DOM rendering, and a CSS selector. Define these using a @Component decorator, which holds metadata including selector and template. Optionally, include CSS styles in the styles property or use separate files via templateUrl and styleUrl, relative to the component directory. To use a component, directive, or pipe, add it to the imports array within the @Component decorator. By default, components are standalone, allowing direct import into other components' imports arrays. Older components may specify standalone: false, requiring the import of the corresponding NgModule instead. Scope: Angular. Reviewed October 4, 2026.
Components as the building block
Document v1 · published by Koskamo editorial · updated 2026-10-04
Source and provenance
- Original source
- angular.dev
- Published on Koskamo by
- Koskamo editorial
- Citation version
- Document v1
- Reuse
- Original summaries; linked sources retain their own terms.