这是如何根据需要创建工具提示的蓝图(或使用ui-bootstrap的工具提示进行修改/合并)。
app.directive("myTooltipTemplate", function($compile){ var contentContainer; return { restrict: "A", scope: { myTooltipScope: "=" }, link: function(scope, element, attrs, ctrl, linker){ var templateUrl = attrs.myTooltipTemplate; element.append("<div ng-include='"" + templateUrl + ""'></div>"); var toolTipScope = scope.$new(true); angular.extend(toolTipScope, scope.myTooltipScope); $compile(element.contents())(toolTipScope); } };});当然,它没有任何实际的工具提示功能,例如弹出窗口,放置等…-它只是将已编译的模板附加到此指令适用的任何元素上。
柱塞
更换了具有更接近工具提示行为的弹头;



