2 * Created by rc2122 on 5/4/2017.
4 import {Component, Input, Output, EventEmitter, ViewChild} from "@angular/core";
5 import {InputFEModel} from "app/models";
6 import {ConfirmationDeleteInputComponent} from "./confirmation-delete-input/confirmation-delete-input.component";
9 selector: 'inputs-table',
10 templateUrl: './inputs-table.component.html',
11 styleUrls: ['../inputs-table/inputs-table.component.less']
13 export class InputsTableComponent {
15 @Input() inputs: Array<InputFEModel>;
16 @Input() readonly:boolean;
17 @Input() isLoading:boolean;
18 @Output() inputValueChanged: EventEmitter<any> = new EventEmitter<any>();
19 @Output() deleteInput: EventEmitter<any> = new EventEmitter<any>();
20 @ViewChild ('deleteInputConfirmation') deleteInputConfirmation:ConfirmationDeleteInputComponent;
22 selectedInputToDelete:InputFEModel;
27 onInputValueChanged = (input) => {
28 this.inputValueChanged.emit(input);
31 onDeleteInput = () => {
32 this.deleteInput.emit(this.selectedInputToDelete);
35 openDeleteModal = (input:InputFEModel) => {
36 this.selectedInputToDelete = input;
37 this.deleteInputConfirmation.openModal();