mirror of
https://github.com/github/codeql.git
synced 2026-01-13 22:44:48 +01:00
14 lines
422 B
JavaScript
14 lines
422 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(element)(scope); // NOT OK
|
|
}
|
|
};
|
|
});
|