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

add validateOn to ng-model-options to make the $parsers run even when updates are pending #7016

Open
shahata opened this issue Apr 6, 2014 · 9 comments

Comments

@shahata
Copy link
Contributor

shahata commented Apr 6, 2014

On many cases it makes sense to have something like {updateOn: 'blur', validateOn: 'default'}. If this sounds reasonable to you I can have this PR ready this week. @petebacondarwin @lrlopez @IgorMinar - what do you think about this?

@petebacondarwin
Copy link
Contributor

Waiting for new validator pipeline to be merged before tackling this one.

@shahata
Copy link
Contributor Author

shahata commented Jun 15, 2014

@petebacondarwin I've rebased this with the new validator pipeline change, but I think it needs to wait until #7836 is resolved

@petebacondarwin petebacondarwin modified the milestones: Ice Box, 1.3.0 Jul 3, 2014
@btford btford removed the gh: issue label Aug 20, 2014
@pocesar
Copy link
Contributor

pocesar commented Aug 22, 2014

+1

@IgorMinar
Copy link
Contributor

I'm not a fan of this because it only adds more options and states without clear benefits.

@IgorMinar
Copy link
Contributor

Can you provide some strong use-cases that are not possible to implement in Angular 1.3 today?

@shahata
Copy link
Contributor Author

shahata commented Oct 2, 2014

@IgorMinar I've discussed this with @petebacondarwin a couple of months ago and we both agreed that we don't see a very strong use case for this. I don't mind closing this and wait to see if someone asks for something similar in the future.

@levic
Copy link

levic commented Jan 18, 2016

A use case that would be handled easily with validateOn

http://plnkr.co/6vRyCd94k36B6EDXPcmr

By using ngModelOptions="{updateOn: 'submit'}" it allows you to not have to shadow the ng-model data you are modifying.

Unfortunately it also means that it is not possible to easily provide validation feedback to the user. Adding validateOn would make this much simpler.

@BoLaMN
Copy link

BoLaMN commented Feb 5, 2016

i had the same use case as @levic so i made two decorators to enable this functionality

https://github.com/BoLaMN/angular-validate-on

@sryzycki
Copy link

sryzycki commented Jun 6, 2017

+1

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

Successfully merging a pull request may close this issue.

9 participants