-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

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
  • 623,577
  • 216
  • 2,003
  • 1,567