Angular -ui: using a popover pattern template

I posted an earlier question: angular -ui-bootstrap: html implementation in popover using popover-html and it was suggested to use popover-template.

<i popover-template="popover-partial.html" popover-title="In Progress" class="glyphicon glyphicon-info-sign"></i>

<script type="text/ng-template" id="popover-partial.html">
    <b>Jody</b>
</script>

So I'm trying to do this, but now popover will not activate when clicked.

I am using version 0.13.4.

+4
source share
2 answers

popover-templatevalue must be string, otherwise you could say that he needs expression/ scopeVariable.

<i popover-template="'popover-partial.html'" 
  popover-title="In Progress" 
  class="glyphicon glyphicon-info-sign">
</i>

Demo

+8
source

, . , , . , script html-.

:

<i popover-template="popover.templateUrl" 
popover-title="popover.title" class="glyphicon glyphicon-info-sign"></i>

<script type="text/ng-template" id="popover-partial.html">
<b>Jody</b>
</script>

:

$scope.popover = {
templateUrl: 'popover-partial.html',
title: 'Title'
};
+2

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


All Articles