How to use Bootstrap Popover with Angular2

Dylan Harness picture Dylan Harness · Mar 7, 2016 · Viewed 25.9k times · Source

I am trying to get a Bootstrap 3 popover to display an Angular 2 interpolated template. Is this possible? Here is what I have so far:

    $('.ba-header--user-menu').popover({
      placement: 'bottom',
      toggle: 'popover',
      trigger: 'focus',
      html: true,
      content: '{{user.email}}'
    });

Which gives me this:

enter image description here

Answer

pleerock picture pleerock · Jun 16, 2016

JQuery and Angular don't play very well together. Install ng2-popover:

npm i ng2-popover

and use it like this:

<span popover="content to be shown in the popover">
    element on which this popover is applied.
</span>