1

Is there any way to add Angular Tooltips dynamically from within the controller? I tried setting the attributes from the controller which does not work.

$("#test").attr("bs-tooltip", "content");
madth3
  • 7,275
  • 12
  • 50
  • 74
kefeizhou
  • 6,234
  • 10
  • 42
  • 55
  • See this answer: http://stackoverflow.com/questions/16651227/enable-angular-ui-tooltip-on-custom-events – Derek Oct 18 '13 at 18:03

2 Answers2

4

Does it need to be an angular-strap tooltip, or can you just use bootstrap itself? Something like

$("#test").tooltip({
    title: 'content',
    trigger: 'hover',
    // ...
});
Andyrooger
  • 6,748
  • 1
  • 43
  • 44
0

Angular-Strap won't show the tooltip if the text is "", so if you know you will need or might want a tooltip, you could start with the text being "" and dynamically change it.

Alternatively, the documentation claims:

Both $scope.show() and $scope.hide() are available inside the tooltip to toggle its visibility.

Although its not clear to me how to use this functionality.

JBCP
  • 13,109
  • 9
  • 73
  • 111