如何在angular中使用bootstrap popover数据内容中的模板

时间:2016-07-19 17:35:20

标签: angularjs popover

您好我需要在使用地图标记的图像上显示弹出框。

问题出在popover我需要显示一个表单,但我无法在引导带的数据内容中呈现一个html页面。

我做了类似的尝试 https://plnkr.co/edit/CBhLV7?p=preview

指令

angular.module('app').directive('iconPopover',['$templateCache',function($templateCache){
  return{
    restrict: 'E',
    template: $templateCache.get('form.html')
  }
}])

// index.html的

< img src="https://s-media-cache-ak0.pinimg.com/236x/bb/54/8b/bb548b6fa0862e92302c4ba4fb1a85ed.jpg" usemap="#mymap" />

< map name="mymap">
  < div style="border:1px solid green; position:absolute; width:60px; height:60px; 
  left:{{marker.XPos}}px; top:{{marker.YPos}};"
    data-html="true"
    data-toggle="popover"
    data-trigger="focus"
    data-content="<icon-popover></icon-popover>"
    ng-repeat="marker in markers"
    ng-click="showPopover($event)"
  >
     <area 
    shape="{{marker.shape}}" 
    coords="{{marker.coords}}" 
    href="#" />

  </ div>

0 个答案:

没有答案