Skip to content

Validate functions should be called with useful properties #30

@Macrofig

Description

@Macrofig

Need to at least pass new value and property key name to the resulting compute of a validate property function.

For example, the following define property:

myVal: {
  type: 'string',
  validate: {
    required: function () {
      return this.attr('isRequired') || false;
    },
    validateOnInit: true
  }
}

The required function should have the new value and the property name in the arguments. So...

    required: function (newVal, key) {
      return this.attr('isRequired') || false;
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions