NG Absolute Form Validator - V14.1

Required

The Required rule is the most basic and most common check available — it simply confirms that a field has been filled in and rejects an empty value, whether that's an untouched text input, an empty string, or an unset select. It's the default guard on nearly every field a form genuinely can't do without, from a signup form's email address to a checkout form's shipping address. When a field is only sometimes mandatory — depending on another field's value or presence — the required_if, required_unless, required_with, required_with_all, required_without, and required_without_all rules give you that conditional version instead of a flat, always-on requirement.

#Directive Code Snippet
<!DOCTYPE html> 
<html lang="en"> 
    ...
    <form (ngSubmit)="onSubmit(form)" #form="ngForm">
		<input required type="text" name="<name>" [(ngModel)]="<name>" #<name>="ngModel">
        <ng-absolute-validator [formInstance]="<name>"></ng-absolute-validator>
	</form>
    ...
</html>
#Chain Rule Code Snippet
<!DOCTYPE html> 
<html lang="en"> 
    ...
    <form (ngSubmit)="onSubmit(form)" #form="ngForm">
		<input rule="required" type="text" name="<name>" [(ngModel)]="<name>" #<name>="ngModel">
        <ng-absolute-validator [formInstance]="<name>"></ng-absolute-validator>
	</form>
    ...
</html>
#Reactive Form Code Snippet
//component.ts 
export class ReactiveComponent{

	public form  !: FormGroup;

  	constructor(
      	private fb : FormBuilder,
		private rv : ReactiveValidator,
	){this.generteForm()}

	generteForm(){
		this.form = this.fb.group({
			<name> : ['',this.rv.map('required',<CUSTOM_MESSAGE>)]
		})
	}
}

//component.html 
<!DOCTYPE html> 
<html lang="en"> 
    ...
    <form [formGroup]="form">
		<input type="text" name="<name>" formControlName="<name>">
        <ng-absolute-validator [formInstance]="form.get(<name>)"></ng-absolute-validator>
	</form>
    ...
</html>>