ui boostrap popover与html导致错误

时间:2016-07-18 01:33:13

标签: angularjs angular-ui-bootstrap

我的ui-boostrap popovers正在发生一些非常奇怪的事情。我按照示例here创建了一个内置html的ui-boostrap popover。这基本上是

  <button uib-popover-html="htmlPopover" class="btn btn-default">HTML Popover</button>

我的控制器中有以下内容

  $scope.htmlPopover = $sce.trustAsHtml('<b style="color: red">I can</b> have <div class="label label-success">HTML</div> content');

但是,点击后弹出窗口不会打开,单击

会产生以下错误
angular.js:11598 TypeError: c.push is not a function
    at Function.E.$$addBindingInfo (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js:74:101)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js:213:205
    at $ (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js:70:488)
    at v (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js:59:443)
    at g (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js:52:9)
    at g (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js:52:26)
    at v (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js:59:387)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js:67:146
    at g (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js:52:9)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js:51:118 <div class="popover-content ng-binding" ng-bind-html="contentExp()">

angular.js:11598 TypeError: html.indexOf is not a function
    at htmlParser (angular-sanitize.js:205)
    at $sanitize (angular-sanitize.js:119)
    at Object.ngBindHtmlWatchAction [as fn] (angular-sanitize.js:420)
    at l.$digest (angular.js:14230)
    at angular.js:14427
    at e (angular.js:4902)
    at angular.js:5282(anonymous function) @ angular.js:11598(anonymous function) @ angular.js:8548$digest @ angular.js:14248(anonymous function) @ angular.js:14427e @ angular.js:4902(anonymous function) @ angular.js:5282

我正在使用角度版本1.3.10,如果这有所不同。

0 个答案:

没有答案