Stop Modeling Angular Screens with Five Booleans
Open almost any mature Angular screen and you will find the same shape: 1 2 3 4 5 loading = false; error: string | null = null; data: Account[] | null = null; retrying = false; submitted = false; The template then becomes a negotiation: 1 2 3 4 5 6 7 8 9 @if (loading) { <app-spinner /> } @else if (error) { <app-error [message]="error" /> } @else if (!data?.length) { <app-empty-state /> } @else { <account-table [rows]="data!" /> } This looks fine. It ships. It passes review. And then production teaches you that the screen was never modeled as one thing. It was modeled as five independent switches that sometimes agree and sometimes do not. ...