Using Bootstrap Tooltip with AngularJS

后端 未结 19 1592
抹茶落季
抹茶落季 2020-12-07 10:40

I am trying to use the Bootstrap tooltip in an app of mine. My app is using AngularJS Currently, I have the following:

19条回答
  •  星月不相逢
    2020-12-07 11:08

    impproving @aStewartDesign answer:

    .directive('tooltip', function(){
      return {
        restrict: 'A',
        link: function(scope, element, attrs){
          element.hover(function(){
            element.tooltip('show');
          }, function(){
            element.tooltip('hide');
          });
        }
      };
    });
    

    There's no need for jquery, its a late anwser but I figured since is the top voted one, I should point out this.

提交回复
热议问题