-2

I am using a bootstrap popover with angular 2. Inside the popover the (click) function is not working.

Anyone know the solution.

PKB
  • 1
  • 2
  • please show your template code – rinukkusu Jun 29 '16 at 23:43
  • This isn't enough information for anyone to figure out a solution. If you would please use a [plnkr](https://plnkr.co/) or paste in some of your code we would be able to help much better. – Jarod Moser Jun 30 '16 at 00:10

1 Answers1

1

If you add HTML string to the DOM using [innerHTML] or add it dynamically by other means, Angular2 expressions like bindings or component and directive selectors are not processed by Angular2 in any way and just added as-is to the DOM.

You can query the element after it was added and add an event listener imperatively.

See also Angular 2 innerHTML (click) binding

Community
  • 1
  • 1
Günter Zöchbauer
  • 558,509
  • 191
  • 1,911
  • 1,506