Skip to content

docs(form-field): the example for the mat-error is using a function call in template #28732

Closed
@mpricu

Description

@mpricu

Documentation Feedback

The example for the form field mat-error is using a function call in the template:
@if (email.invalid) {
{{getErrorMessage()}}
}
Best practices mentions to avoid using function calls in templates, but the documentation contains this example since the Material version 5. After all, is it correct using a function call in template for the mat-error?

Affected documentation page

https://material.angular.io/components/form-field/overview#error-messages

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsdocsThis issue is related to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions