1

I need to add popover to a div. However, I need to add it dynamically.

<div popover="Please select from dropdown">foo foo foo</div>

I've tried ng-class but looks like it's not a class. I tried ng-attr-hidden but also didn't work.

1 Answer 1

1

You can just set the popover content in your controller and then apply it:

<div popover="{{dynamicPopover}}">Some text</div>

if dynamicPopover is empty, then there is no popover displayed

This is actually almost exactly the same example as they use in the docs (link)

Sign up to request clarification or add additional context in comments.

2 Comments

Never thought of that! I do that always. I'll try it now :)
Havvy, just search popover from this link - angular-ui.github.io/bootstrap

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.