Как показать html по умолчанию с помощью angular ui bootstrap?

Я делаю демонстрацию поп-музыки, подобную этой. Он показывает всплывающее окно с правой стороны, когда я нажимаю кнопку. Но теперь проблема в том, что я покажу некоторые html по умолчанию.

<html ng-app="plunker">

  <head>
     <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js"></script>
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
    <script src="example.js"></script>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
  </head>

  <body>
    <button popover-placement="right" popover="On the Right!" class="btn btn-default">Right</button>
  </body>
<script>
angular.module('plunker', ['ui.bootstrap']);

</script>  

</html>

У меня есть этот HTML-код. Мне нужно, как добавить это в pop. Я знаю, что в bootrap.js есть способ добавить html в popover. Я не хочу использовать это, я хочу использовать angular пользовательский интерфейс .js

<div ng-controller="axcont">
<ul class="list-group">
  <li class="list-group-item" ng-click="add()">add row</li>
  <li class="list-group-item " ng-click="deleteRow($index)">Deleterow</li>

</ul>
</div>

Я делал больше попыток так, но получаю undefined. Может быть, я ошибаюсь, я просто делаю RND

<html ng-app="plunker">

  <head>
     <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js"></script>
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
    <script src="example.js"></script>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"/>
  </head>

  <body>
    <button pop-over title="Mode of transport" content-url="pop.html" class="btn btn-default">Right</button>
  </body>
<script>
var a=angular.module('plunker', ['ui.bootstrap']);
a.directive('popOver', function ($compile, $http, $templateCache) {
  return {
    restrict: 'A',
    scope: true,
    link: function popOverPostLink(scope, elem, attrs) {
      $http.get(attrs.contentUrl, {cache: $templateCache}).success(
        function (tmpl) {
          var options = {
            content: $compile(tmpl)(scope),
            placement: 'bottom',
            html: true,
            trigger:'click',
            title: attrs.title
          };
          elem.popover(options);
          scope.hidePopover = function () {
            elem.popover('hide');
          }
        }
      );
    }
  };
});

</script>  

</html>

Ответы

Ответ 1

Использовать директиву AngularUI Bootstrap tooltip-html-unsafe

<span tooltip-html-unsafe="<div>Hi</div><div>Hi Hi Hi</div><div>Hi</div>">   
   <b>Hover on Me!</b>
</span>

Демо и код здесь Plnkr tooltip-html-unsafe

Ответ 3

tooltip-html-unsafe С тегом изображения и стиля

<span tooltip-html-unsafe="<img src='https://upload.wikimedia.org/wikipedia/commons/0/00/Lubuntu-icon.png' style='width:24px;'>
      <div style='font-size:24px;'>Tooltip With Image</div>">   
           <b>Hover on Me!</b>
</span>

Ответ 4

tooltip-html-unsafe вы можете вставить что-нибудь в него

Ответ 5

В соответствии с документами Angular-ui вы должны определять popover как uib-popover, а не только popover, и если вы хотите связать html с popover, вы либо использовали бы uib-popover-html="<div> hello </div>", либо привязку шаблона uib-popover-template="<<teamplateNameHere>>"