Documentation
README
Angular Modern APIs
This skill describes the mandatory coding standards for Angular components in our codebase.
Rules
All Angular components must follow these rules:
- Use signal-based inputs — Use
input()andoutput()instead of@Input()and@Output()decorators - Use
inject()for DI — Useinject()function instead of constructor parameter injection - Use built-in control flow — Use
@if,@for,@switchinstead of*ngIf,*ngFor,*ngSwitch
Examples
Signal inputs (correct)
import { Component, input, output } from '@angular/core';
@Component({ ... })
export class UserProfileComponent {
name = input.required<string>();
age = input(0);
saved = output<void>();
}
inject() for DI (correct)
This is the opening of the README. Read the full README on GitHub.