aboutsummaryrefslogtreecommitdiffstats
path: root/src/angular/form-elements/validation/validators/base.validator.component.ts
blob: 8fd0361037b779bad3b9b2d5c7330a9b4ff365a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Input, Component, ContentChildren, EventEmitter, Output, QueryList, SimpleChanges, HostBinding } from "@angular/core";

export abstract class ValidatorComponent {

    @Input() public message: any;
    @Input() public disabled: boolean;
    @HostBinding('class') classes;

    public isValid: boolean;

    constructor() {
        this.disabled = false;
        this.isValid = true;
        this.classes = 'sdc-validator sdc-label__error';
    }

    public abstract validate(value: any): boolean;

}