Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

Make validation conditional #54

Closed
bonce164 opened this issue Dec 15, 2014 · 4 comments
Closed

Make validation conditional #54

bonce164 opened this issue Dec 15, 2014 · 4 comments
Milestone

Comments

@bonce164
Copy link

Hi, I really like your library but I would really like to be able to dynamically enable/disable the validation based upon some other model value. e.g.

<div valdr-form-group valdr-enabled="vm.isLive === true">
<input id="onlyValidateWhenLive" name="onlyValidateWhenLive" type="text" />
</div>

I couldn't find a way of passing model values to a custom validator which would be my preferred method.

@philippd
Copy link
Collaborator

This is an interesting feature. Expect a valdr-enabled directive in the next couple of days. I already have a working version of it locally which just needs some polishing.

@philippd philippd self-assigned this Dec 16, 2014
@philippd philippd modified the milestone: 1.1.1 Dec 16, 2014
philippd added a commit that referenced this issue Dec 23, 2014
Allows to dynamically enable and disable the validation with valdr for one or multiple form elements.
closes #54, fixes #55
philippd added a commit that referenced this issue Dec 23, 2014
* origin/master:
  feat(core): Introduce valdr-enabled directive Allows to dynamically enable and disable the validation with valdr for one or multiple form elements. closes #54, fixes #55

Conflicts:
	Gruntfile.js
	src/core/valdrEnabled-directive.js
	src/core/valdrEnabled-directive.spec.js
	src/core/valdrFormItem-directive.js
@philippd
Copy link
Collaborator

@bonce164 i finally managed to push the new directive, after updating the readme i'll build a new release

@bonce164
Copy link
Author

@philippd - awesome, thanks!

@philippd
Copy link
Collaborator

philippd commented Jan 4, 2015

@bonce164 it's now released in 1.1.1

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