0

我正在使用angular-strap 工具提示,在里面我有应该对 做出反应的链接ng-click,但它没有响应。

.html

<span class="add-on input-group-addon" data-title="{{tooltips.date}}" bs-tooltip>
  <i class="glyphicon glyphicon-calendar fa fa-calendar"></i> Dates
</span>

.js

$scope.tooltips = {
  date: '<a class="btn btn-default" ng-click="select()">Select date</a>'
};

$scope.select = function() {
  //doing something and works fine outside tooltip
}

在应用程序.config()中有html设置为true.

angular.extend($tooltipProvider.defaults, {
  template: "static/lib/angular-strap/tooltip.tpl.html",
  trigger: 'click',
  html: true,
  placement: 'bottom-left'
});
4

1 回答 1

1

通过将 data-title 与 html: true 一起使用,您只是传递了一些 html,但它不是由 Angular 编译的。如果您想在工具提示中使用角度指令和数据绑定,请使用“contentTemplate”;这是一个工作的 plunker:http ://plnkr.co/LSl9gyHRKCMYoEGZZQei

于 2014-05-30T15:25:36.193 回答