We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
To be able to partially validate models, I have added a file with this content - which overrides the BsForm provided by this package.
Setting `{{bs-form validationOptions=(hash on=(array 'fieldPath') excludes=(array 'otherPath')) enables this.
I'm not sure about model.set('validations.errors', validations.get('errors')); but model.get('isTruelyValid') seems to work.
model.set('validations.errors', validations.get('errors'));
model.get('isTruelyValid')
import ObjectProxy from '@ember/object/proxy'; import { Promise as EmberPromise } from 'rsvp'; import BsForm from 'ember-bootstrap/components/bs-form'; export default BsForm.extend({ validationOptions: {}, validate(model) { return new EmberPromise((resolve, reject) => { let m = model; if (model instanceof ObjectProxy) { m = model.get('content'); } m.validate(this.get('validationOptions')).then( validations => { model.set('validations.errors', validations.get('errors')); model.get('validations.isTruelyValid') ? resolve() : reject(); }, error => { reject(); } ); }); } });
Thoughts? think it might be good to create a PR?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
To be able to partially validate models, I have added a file with this content - which overrides the BsForm provided by this package.
Setting `{{bs-form validationOptions=(hash on=(array 'fieldPath') excludes=(array 'otherPath')) enables this.
I'm not sure about
model.set('validations.errors', validations.get('errors'));
butmodel.get('isTruelyValid')
seems to work.Thoughts? think it might be good to create a PR?
The text was updated successfully, but these errors were encountered: