Skip to content
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 opened this issue Aug 21, 2015 · 2 comments
Closed

feat(ngModelOptions): make defaults globally customizable #12644

NicBright opened this issue Aug 21, 2015 · 2 comments

Comments

@NicBright
Copy link

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

@Narretz
Copy link
Contributor

Narretz commented Aug 21, 2015

There's a PR that implements global config and inheritable options: #10922 It's planned for 1.5

@NicBright
Copy link
Author

Thank you very much for pointing this out. I didn't know about it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants