Angularjs ui bootstrap - put html inside popover

I use the official angular bootstrap directives .

I want to use his popovers.

The documentation says that if you want to insert html inside a popover, you should use popover-html , for example below:

     <button popover-html="{{getTag()}}" type="button" class="btn btn-default">Dynamic Popover</button>
     <button popover-html="<a>Just fucin show me !</a>" type="button" class="btn btn-default">Click me </button>

But this will result in the following console error:

Error: [$ parse: syntax] Syntax error: token '<' and not the primary expression in column 1 of the expression [sdfsdfsdf], starting with [sdfsdfsdf]. http://errors.angularjs.org/1.4.3/ $ parse / syntax? p0 =% 3C & p1 = not% 20a% 20primary% 20expression & p2 = 1 & p3 =% 3Ca% 3Esdfsdfsdf% 3C% 3E% 2fa & p4 =% 3ca% 3Esdfsdfsdf% 3C% 3E% 2fa

You can see plunker

thanks

+1
1

$compile:

HTML:

<button popover-html="getTag()" type="button" class="btn btn-default">Dynamic Popover</button>

JS:

$scope.getTag = function(){
   return '<a>sdfsdfsdf</a>';
}
+1

Source: https://habr.com/ru/post/1610035/


All Articles