angular check if control has required validator
import { AbstractControl } from '@angular/forms';
export const isControlRequired = (control: AbstractControl): boolean => {
if (!control) {
return false;
}
if (control.validator) {
const validator = control.validator({} as AbstractControl);
if (validator && validator.required) {
return true;
}
}
return false;
};
Also in JavaScript:
- js analyse img color
- how to create subclasses in javascript
- access selected option in jquery
- javascript convert array of objects to array of uri
- pdfjs customizing viewer.html js event handler
- jquery works until modal is shown
- js mouse enter
- js filter blur Property
- find label jquery
- iterate through object array javascript
- what is monad in javascript
- find number in array js
- js remove readonly attribute
- how will it look when there is a container inside a a row bootstrap
- react 17 hot reload not working
- has class in jquery
- javascript dom methods list
- run length encoding javascript
- function redirect javascript
- react native textinput no keyboard
- username validation in javascript
- js email regex
- sum all elements in array javascript
- c# print object to json