aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/components/dynamic-element/elements-ui/integer-input/ui-element-integer-input.component.ts
blob: d42c80a89e7c7f0de00c84afed6cd9670d0b75d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import {Component, ViewChild, ElementRef, ContentChildren, Input} from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'
import { UiElementBase, UiElementBaseInterface } from './../ui-element-base.component';

@Component({
    selector: 'ui-element-integer-input',
    templateUrl: './ui-element-integer-input.component.html',
    styleUrls: ['./ui-element-integer-input.component.less'],
})
export class UiElementIntegerInputComponent extends UiElementBase implements UiElementBaseInterface {
    constructor() {
        super();
        this.pattern = this.validation.validationPatterns.comment;
    }

    onSave() {
        if (!this.control.invalid){
            this.baseEmitter.emit(JSON.parse(this.value));
        }
    }
}