Hide angular-ui tooltip on custom event

前端 未结 4 1460
盖世英雄少女心
盖世英雄少女心 2020-12-09 19:50

I\'ve been looking around and trying out different things but can\'t figure it out. Is it possible to hide an angular-ui tooltip with a certain event?

What I want to

4条回答
  •  心在旅途
    2020-12-09 20:42

    Basically you cannot play with the tooltip-trigger to make this work. After digging through the ToolTip directive code, I found that the ToolTip attribute exposes a scope attribute called tt_isOpen.

    So in your ng-click function, if you set this attribute to false, that will make the tooltip hide.

    See the updated demo here

    http://jsfiddle.net/3ywMd/10/

    Like this

    app.controller('MainCtrl', function ($scope) {
     $scope.likes = 999;
     $scope.doSomething = function(){
        //hide the tooltip
        $scope.tt_isOpen = false;
     };                                    
    })
    

提交回复
热议问题