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.
Add option to write invalid $modelValues to scope #8290
Closed
Description
Since the validation refactoring, theoretically all invalid models appear in the input even if invalid. It's however not possible to write an invalid $modelValue to the scope. The $validators now actively set
I propose we use ng-model-options
to make it possible to write the parsed $modelValue to scope even if invalid.
Why is this needed?
- Server-side validation with using $setValidity manually is broken (see $setValidity somehow breaks model binding in 1.3.0 Beta 12 and after #8080 (comment))
- Keeping input regardless of validity (see input not showing invalid model values #1412 (comment))
- Displaying invalid models (from DB etc.): It currently displays the invalid model in the input, but at the same time resets the model to undefined (see http://plnkr.co/edit/Fapn7ePUhajjGNsjwIlg?p=preview)
- All common workarounds for this are broken in 1.3