How to use the ember-validators/messages.getMessageFor function in ember-validators

To help you get started, we’ve selected a few ember-validators 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 offirgolan / ember-validators / tests / helpers / validator-context.js View on Github external
createErrorMessage(type, value, options) {
    set(options, 'description', Messages.getDescriptionFor(undefined, options));
    return Messages.getMessageFor(type, options);
  }
};
github offirgolan / ember-validators / tests / helpers / process-result.js View on Github external
export default function processResult(result) {
  if (result && typeof result === 'object') {
    let { type, context, message } = result;

    if (message) {
      return message;
    }

    set(context, 'description', Messages.getDescriptionFor(undefined, context));
    return Messages.getMessageFor(type, context);
  }

  return result;
}