Skip to content

Config option to wipe the model when a condition is no longer fulfilled? #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jbsaff opened this issue Apr 7, 2015 · 4 comments
Closed

Comments

@jbsaff
Copy link
Contributor

jbsaff commented Apr 7, 2015

I'd like wipe out user input from the model when the condition on a form field is no longer met. Currently the model is updated when a condition is met, but not when it no longer applies. Is there an option that I'm missing? A plain angular ng-if seems to do what I want, but that's because the form only submits elements in the DOM. I'd like to just take the schema-form model as my finished form response and go from there.

Any pointers would be greatly appreciated. Thanks!

@davidlgj
Copy link
Contributor

There has been some discussion on this over at #204, so check that out.

But he TL;DR; is that it's a good idea, at least to have it optionally.

@jbsaff
Copy link
Contributor Author

jbsaff commented Apr 17, 2015

That's exactly what I'm thinking of. Thanks for the pointer. Sorry I missed the open discussion.

@jbsaff
Copy link
Contributor Author

jbsaff commented Apr 23, 2015

I'm not a JS or AngularJS guy by trade (yet!), but I wanted to take a stab at solving my own problem. I had a couple of other form types/decorators I wanted, so I slipped in an extension to the schema-validate directive. https://github.com/jbsaff/angular-schema-form-multiselect for anyone interested. It's not configurable yet, but if I make progress in that direction I'll submit a PR.

@jbsaff
Copy link
Contributor Author

jbsaff commented Apr 28, 2015

Improved my solution and submitted it as a new feature via #371. I'm closing this issue because my initial question was answered and any follow-up can occur in the PR thread.

@jbsaff jbsaff closed this as completed Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants