Merge "[1707-OS] Updated license text according to the"
[sdc.git] / catalog-ui / src / app / directives / inputs-and-properties / properties / property-row-directive.ts
1 /**
2  * Created by obarda on 1/8/2017.
3  */
4 'use strict';
5
6 export interface IPropertyRowDirective extends ng.IScope {
7     onNameClicked:Function;
8     isClickable:boolean;
9 }
10
11 export class PropertyRowDirective implements ng.IDirective {
12
13     constructor() {
14
15     }
16
17     scope = {
18         property: '=',
19         instanceName: '=',
20         instanceId: '=',
21         instancePropertiesMap: '=',
22         onNameClicked: '&',
23         onCheckboxClicked: '&'
24     };
25
26     restrict = 'E';
27     replace = true;
28     template = ():string => {
29         return require('./property-row-view.html');
30     };
31
32     link = (scope:IPropertyRowDirective, element:any, $attr:any) => {
33         scope.isClickable = $attr.onNameClicked ? true : false;
34     };
35
36     public static factory = ()=> {
37         return new PropertyRowDirective();
38     };
39
40 }
41
42 PropertyRowDirective.factory.$inject = [];