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");
1

2 Answers 2

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',
    // ...
});
Sign up to request clarification or add additional context in comments.

1 Comment

Seems better than adding directives after compilation...if you do need to do it from a controller.
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.