How to use the ember-changeset.Changeset function in ember-changeset

To help you get started, we’ve selected a few ember-changeset examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hashicorp / consul / ui / packages / consul-ui / app / services / change.js View on Github external
changesetFor(modelName, model, options = {}) {
    const validator = this.validatorFor(modelName, options);
    let changeset;
    if (validator) {
      let validatorFunc = validator;
      if (typeof validator !== 'function') {
        validatorFunc = lookupValidator(validator);
      }
      changeset = createChangeset(model, validatorFunc, validator, { changeset: Changeset });
    } else {
      changeset = createChangeset(model);
    }
    return changeset;
  }
github hashicorp / consul / ui-v2 / app / utils / form / builder.js View on Github external
const defaultChangeset = function(data, validators) {
  return createChangeset(data, lookupValidator(validators), validators, { changeset: Changeset });
};
/**
github hashicorp / consul / ui / packages / consul-ui / app / services / change.js View on Github external
changesetFor(modelName, model, options = {}) {
    const validator = this.validatorFor(modelName, options);
    let changeset;
    if (validator) {
      let validatorFunc = validator;
      if (typeof validator !== 'function') {
        validatorFunc = lookupValidator(validator);
      }
      changeset = createChangeset(model, validatorFunc, validator, { changeset: Changeset });
    } else {
      changeset = createChangeset(model);
    }
    return changeset;
  }