This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable @typescript-eslint/no-unused-vars */ | |
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
import { InjectionToken } from '@angular/core'; | |
const defaultErrors: { | |
[key: string]: any; | |
} = { | |
min: ({ minimum, actual }: any) => `Value must be at least ${minimum}`, | |
max: ({ maximum, actual }: any) => `Value must be less than ${maximum}`, | |
required: () => `This field is required`, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, effect, input } from '@angular/core'; | |
import { FormGroupDirective } from '@angular/forms'; | |
/** | |
* Add [disabled] directive to FormGroup for convenience. | |
* | |
* @usageNotes | |
* Give convienient utility for disabling form submit with 'form.disabled'. | |
* <button type="submit" [disabled]="form.invalid || form.disabled">Submit</button> | |
*/ |