Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { isNumber } from 'util';
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-reactive-universal-validator',
templateUrl: './universal-validator.component.html',
styleUrls: ['./universal-validator.component.css']
})
export class ReactiveFormUniversalValidatorComponent implements OnInit {
form: FormGroup;
noWhitespace: FormControl = new FormControl('', Validators.compose([
Validators.required,
UniversalValidators.noWhitespace
]));
noEmptyString: FormControl = new FormControl('', Validators.compose([
Validators.required,
UniversalValidators.noEmptyString
]));
min: FormControl = new FormControl('', Validators.compose([
Validators.required,
UniversalValidators.min(5)
]));
max: FormControl = new FormControl('', Validators.compose([
Validators.required,
UniversalValidators.max(10)
]));