mirror of
https://github.com/github/codeql.git
synced 2026-03-08 08:36:44 +01:00
14 lines
418 B
JavaScript
14 lines
418 B
JavaScript
angular.module('myapp')
|
|
.directive('addToolTip', function($compile) {
|
|
return {
|
|
link: function(scope, element, attrs) {
|
|
var tooltip = angular.element('<span ng-show="showToolTip">A tooltip</span>');
|
|
tooltip.on('mouseenter mouseleave', function() {
|
|
scope.$apply('showToolTip = !showToolTip');
|
|
});
|
|
element.append(tooltip);
|
|
$compile(tooltip)(scope); // OK
|
|
}
|
|
};
|
|
});
|