-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
Description
Right now, we have:
export class FieldValidationResult {
key: string;
type: string;
succeeded: boolean;
errorMessage: string;
constructor() {
this.key = '';
this.type = '';
this.succeeded = false;
this.errorMessage = '';
}
}When a user has to create validation function that resolve a FieldValidationResult, he has to provide an empty key property:
e.g:
./requiredValidation.ts
export const required => (vm, value) : FieldValidationResult => {
return {
key: '',
type : 'REQUIRED',
succeeded : (value && value.length > 0),
errorMessage : 'Mandatory field',
}
}I think key property should be a private property because it's only used internally