dhrm
dhrm

Reputation: 14934

Angular Bootstrap: Tooltip placement based on function

I'm using the Angular Bootstrap Popover:

<button popover-placement="top" popover="On the Top!" class="btn btn-default">Top</button>

If using default Bootstrap JavaScript, it's possible to define the placement using a function.

How can this be done using Angular Bootstrap? I would like to switch from right to left on a mobile device. (width < 768 px).

Upvotes: 1

Views: 2507

Answers (1)

Anita
Anita

Reputation: 2400

define one variable 'placement' in controller for placement. and change html code to

<button popover-placement="{{placement}}" popover="On the Top!" class="btn btn-default">Top</button>

now you can change placement of tooltip in controller on condition

Upvotes: 2

Related Questions