Q:

angular sanitize vs validators

this.slideOneForm = formBuilder.group({
    firstName: ['', Validators.compose([Validators.maxLength(30), Validators.pattern('[a-zA-Z ]*'), Validators.required])],
    lastName: ['', Validators.compose([Validators.maxLength(30), Validators.pattern('[a-zA-Z ]*'), Validators.required])],
    age: ['', AgeValidator.isValid]
});
0
this.myForm = formBuilder.group({
    firstName: ['value'],
    lastName: ['value', *validation function goes here*],
    age: ['value', *validation function goes here*, *asynchronous validation function goes here*]
});
0
this.myForm = new FormGroup({
    firstName: new FormControl('Josh'),
    lastName: new FormControl('Morony')
});
0
this.myControl = new FormControl('value', *validation function goes here*, *asynchronous validation function goes here*);
0

New to Communities?

Join the community