Hide angular-ui tooltip on custom event

前端 未结 4 1451
盖世英雄少女心
盖世英雄少女心 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:26

    Michael's solution got me 90% of the way there but when I executed the code, angular responded with "$digest already in progress". I simply wrapped the trigger in a timeout. Probably not the best solution, but required minimal code

    // ... meanwhile, in JavaScript land, in your custom event handler...
    if (angular.element('#myButton').scope().tt_isOpen) {
        $timeout( function(){
            angular.element('#myButton').trigger('click');
        }, 100);
    }
    

提交回复
热议问题