Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(ngModelController): add $warning #13465

Open
@0x-r4bbit

Description

@0x-r4bbit

We currently have $error as part of ngModelController and formController to represent errors when validations have failed on certain form inputs.

This is already super powerful and covers almost all use cases, however, recently when I was reviewing an application a new use case occurred.

Motivation

Some inputs of a form of the application allow any value but should display a warning if the value is a different type of what it is supposed to be.

Example:

A text input for phone number. The user is allowed to type in numbers and letters and the model gets updated, but should get a warning that displays information that it might be a wrong value.

Proposal

Introduce $warning next to $error on ngModelController/FormController to take advantage of the same mechanisms we use to display errors (ngMessages, etc.) except that the model gets updated regardless of if warning occurs or not.

/cc @cburgdorf

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions