summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/info-tooltip/info-tooltip.ts
blob: 63ecdc6091f1e37cbf46fe747382c76b0e9fc6d5 (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
/**
 * Created by rcohen on 9/25/2016.
 */
'use strict';

export interface IInfoTooltipScope extends ng.IScope {
    infoMessageTranslate:string;
    direction:string;
}


export class InfoTooltipDirective implements ng.IDirective {

    constructor() {
    }

    scope = {
        infoMessageTranslate: '@',
        direction: '@'//get 'right' or 'left', the default is 'right'
    };

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

    link = (scope:IInfoTooltipScope, element:any, $attr:any) => {
        scope.direction = scope.direction || 'right';
    };

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

InfoTooltipDirective.factory.$inject = [];