feat(ngModelController): add $warning #13465
Description
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