Javascript AngularJS和BootstrapUI-将函数和参数传递给BootstrapUI指令

Javascript AngularJS和BootstrapUI-将函数和参数传递给BootstrapUI指令,javascript,angularjs,angularjs-bootstrap,Javascript,Angularjs,Angularjs Bootstrap,我想将一个函数传递给BootstrapUI的popover指令。该属性通常是一个字符串,但我需要执行一个AJAX调用来向指令提供该属性。当前,popover将函数显示为字符串,例如“showItem(one)”,而不是调用函数的结果,例如“Item is one”。谢谢 HTML <li ng-repeat="item in items" popover-placement="top" popover-trigger="mouseenter" u

我想将一个函数传递给BootstrapUI的popover指令。该属性通常是一个字符串,但我需要执行一个AJAX调用来向指令提供该属性。当前,popover将函数显示为字符串,例如“showItem(one)”,而不是调用函数的结果,例如“Item is one”。谢谢

HTML

    <li ng-repeat="item in items"
      popover-placement="top"
      popover-trigger="mouseenter"
      uib-popover="showItem({{item.id}})">
      {{item.id}}
    </li>
代码笔


{{item.id}

我在这里有点失败,这可以正常工作,但我打算在showItem中模拟ajax调用,我将尝试编辑代码笔以模拟ajax响应。ThanksIt看起来我需要编写一个新的指令来触发popover,例如link(scope,elem){doAjaxCall..elem.popover(ajaxResponse)},如果这样做有意义的话。当我让它工作时,我会回来回答这个问题。
app.controller("uibController", ["$scope", function ($scope) {
$scope.items = [
    {id: "one"},
    {id: "two"},
    {id: "three"}
];
$scope.showItem = function(item){
    $http.get('url').success(function(response){
    //data for popover directive
    return "Item is " + item.id;
})

};
}]);