aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/inputs-and-properties/inputs/input-row-directive.ts
blob: 221c20d08f81ba0baeb63196ff8dd9a2008f66d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
 * Created by obarda on 1/8/2017.
 */
'use strict';

export interface IInputRowDirective extends ng.IScope {
    showDeleteIcon:boolean;
}


export class InputRowDirective implements ng.IDirective {

    constructor() {

    }

    scope = {
        instanceInputsMap: '=',
        input: '=',
        instanceName: '=',
        instanceId: '=',
        isViewOnly: '=',
        deleteInput: '&',
        onNameClicked: '&',
        onCheckboxClicked: '&'
    };

    restrict = 'E';
    replace = true;
    template = ():string => {
        return require('./input-row-view.html');
    };

    link = (scope:IInputRowDirective, element:any, $attr:any) => {
        scope.showDeleteIcon = $attr.deleteInput ? true : false;
    };

    public static factory = ()=> {
        return new InputRowDirective();
    };
}

InputRowDirective.factory.$inject = [];