Bootstrap popover在AngularJs ng-repeat中不起作用

我有一个国家列表,我正在使用ng-repeat填充,一切都运行正常.此外,我试图通过使用引导弹出窗口显示每个国家内的一些其他细节,它似乎没有工作,所以有人可以帮助我吗?

Html代码

<body ng-app="app" ng-controller="my_controller">    
<div class="span3 projectCard" ng-repeat="country in all_countries">
    <div class="projectCardHeight">
        <button class="btn close cardClose" ng-click="deleteCountry(country.id)">×</button>
        <div class="cardHeader">Country</div>
        <div class="cardBody">{{country.id}}</div>
        <div class="cardBody">{{country.title}}</div>
        <div class="cardBody"><a href="#" id="pop{{country.id}}" class="btn btn-primary" rel="popover" data-content="This is the <b>body</b> of Popover" data-original-title="Creativity Tuts">pop</a></div>
    </div>
</div>
 </body>

Javascript代码

var app = angular.module("app",[]);
app.controller('my_controller',function($scope) {  
    $scope.all_countries = [
        {"id":28,"title":"Sweden"},{"id":56,"title":"USA"},{"id":89,"title":"England"}];
});

function deleteCountry(id)
{
    alert("Do something");
}

$(document).ready(function () {
    $("a[rel=popover]")
        .popover({ placement: 'bottom',html: 'true' })
        .click(function (e) {
            e.preventDefault();
        });
});

请参考这个JsFiddle

解决方法

演示: http://jsfiddle.net/5ww8e/1/

创建一个名为bs-popover的新指令,并将其与ng-repeat一起应用.在bs-popover指令内触发popover方法.

你的js文件加载顺序也是错误的,你应该在bootstrap之前加载jquery.

相关文章

Bootstrip HTML 查询搜索常用格式模版 &lt;form class=&...
如何在按钮上加红色数字 您可以使用Bootstrap的badge组件来在...
要让两个按钮左右排列,你可以使用 Bootstrap 的网格系统将它...
是的,可以将status设置为布尔类型,这样可以在前端使用复选...
前端工程师一般用的是Bootstrap的框架而不是样式,样式一般自...
起步导入:<linkrel="stylesheet"href="b...