I want to show angular UI bootsrap tooltip only when the text is truncated. I tried the below code with custom directive
<div tooltip="{{value}}" tooltip-append-to-body="true" enable-truncate-tooltip>{{value}}</div>
.directive("enableTruncateTooltip", function () {
return {
restrict: 'A',
link: function (scope, elem, attr) {
elem.bind('mouseenter', function () {
var $this = angular.element(this);
if (this.offsetWidth >= this.scrollWidth) {
angular.element('.tooltip').attr('hide-tooltip', true);
}
});
}
}
})
It works fine in angular-ui-bootstrap version 0.12.1. But later versions are not supporting this.
How can i achieve this same functionality in latest version of angular-ui-bootstrap?
Thanks in advance for your help.