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(ngModelOptions): make defaults globally customizable #12644

Closed
@NicBright

Description

@NicBright

Hi there,

in the project I'm currently involved in, we basically always want to have "allowInvalid: true". For now, we've created a wrapper for our form components which takes care of that (inside its template we just add ng-model-options="{ allowInvalid: true }" and we're good to go).

Unfortunately, this often leads to the following problem:

Some fields need other stuff from ng-model-options too (like e.g. setting updateOn: 'blur'). What really happens a lot now is the fact that the developer is not aware that he also has to specify allowInvalid: true again. Everytime a developer forgets to add this, we end up with invalid values not being written to the model, which leads to a bad user experience in our case (because a user may navigate back and forth between forms and the user should not lose any (even invalid) input while doing so).

This problem could be avoided by adding a new feature:

As a developer,
I would like to be able to globally specify defaults for ngModelOptions,
in order not to experience the pitfalls described above.

Thank you very much for reading and considering this.

Regards,
Nicolas

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions