在popover中突出显示自定义指令自定义指令在angularjs中不起作用

时间:2019-01-16 11:18:22

标签: angularjs popover highlight.js custom-directive

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 个答案:

没有答案
相关问题