How to use the ngx-custom-validators.CustomValidators.rangeLength function in ngx-custom-validators

To help you get started, we’ve selected a few ngx-custom-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 NarikMe / narik-angular / projects / narik-core / src / lib / services / narik-validation.service.ts View on Github external
func: CustomValidators.notEqual,
      params: ["notEqual"]
    },
    notEqualTo: {
      func: CustomValidators.notEqualTo,
      params: ["notEqualTo"]
    },
    number: {
      func: CustomValidators.number
    },
    range: {
      func: CustomValidators.range,
      params: ["range"]
    },
    rangeLength: {
      func: CustomValidators.rangeLength,
      params: ["rangeLength"]
    },
    url: {
      func: CustomValidators.url
    },
    uuid: {
      func: CustomValidators.uuid
    }
  };

  addValidator(key: string, validator: NarikValidator) {
    this._validators[key] = validator;
  }

  validators() {
    return this._validators;