feat: add form errors dictionaries
This commit is contained in:
18
src/app/errors-dictionaries/name-and-company-field.ts
Normal file
18
src/app/errors-dictionaries/name-and-company-field.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { inject } from '@angular/core';
|
||||
import { Dictionary } from '../interfaces/dictionary.interface';
|
||||
import { STRINGS_INJECTOR } from '../app.config';
|
||||
|
||||
export class NameAndCompanyFieldsErrorsDictionary implements Dictionary {
|
||||
private readonly strings = inject(STRINGS_INJECTOR);
|
||||
private readonly maxlen: string;
|
||||
private readonly required = this.strings.errorMessageRequired;
|
||||
|
||||
constructor() {
|
||||
this.maxlen = this.strings.errorMessageMaxLength(120);
|
||||
}
|
||||
|
||||
getDictionary(): { [key: string]: string } {
|
||||
const { maxlen, required } = this;
|
||||
return { maxlen, required };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user