Skip to content

UI Copy In Template ​

UI copy (labels, errors, tooltips) lives in the template. The component exposes booleans or an Enum<T> union (No Magic Values) for the condition. The template inlines the literal text inside the matching @if or @switch branch.

Why ​

Everything the user reads is found in the template.

How To Apply ​

Flag names describe the state (hasForbiddenError), not the message.

html
@if (hasForbiddenError) { <callout>No access to this app.</callout> }

With a translate pipe:

html
@if (hasForbiddenError) { <callout>{{ 'errors.forbidden' | translate }}</callout> }