@chatterton/angular2-schema-form
Version:
Angular2 Schema Form (DISCLAIMER: it is not related to angular-schema-form)
18 lines (13 loc) • 325 B
text/typescript
import { Validator } from './validator';
export class ValidatorRegistry {
private validators: Validator[] = [];
register(path: string, validator: Validator) {
this.validators[path] = validator;
}
get(path: string): Validator {
return this.validators[path];
}
clear() {
this.validators = [];
}
}