在popover自定义指令中调用突出显示指令

时间:2019-01-15 10:45:47

标签: angularjs angularjs-directive highlight popover

popover自定义指令中的highlight自定义指令在angularjs中不起作用

directive('customApmPop', ['$compile',function ($compile) {        
    return {
        restrict: 'A',
        template: '<a class="tablea" highlight=\'\' >{{trimmed}}</a>',
        scope : true ,
        link: function (scope, el, attrs) {
            scope.trimmed = attrs.popoverLabel;
            scope.contents = '<div highlight=\'\'>'+attrs.popoverHtml+'</div>';

            $(el).popover({
                trigger: 'hover',
                html: true,
                content: scope.contents,
               // template: '<div highlight=\'\'>{{contents}}</div>',
                placement: attrs.popoverPlacement
            });
        }
    };
    return directive;
}]);

0 个答案:

没有答案