在ng-repeat中错误放置了工具提示

时间:2013-07-23 13:11:03

标签: angularjs angular-ui-bootstrap angular-resource

以下显示了正确位置的工具提示文字:

  %a{:href => "http://google.com/"}
    %span{:tooltip => "TEST"}
      = "test"

以下显示工具提示下方半屏(增加每个元素的距离)

%div{:"ng-repeat" => "point in points"}
  %a{:href => "http://google.com/"}
    %span{:tooltip => "TEST"}
      = "test"

它是用HAML编写的,所以在纯HTML中,最后两行看起来像这样:<span tooltip="TEST">test</span>

使用Rails $Resource获取points,但在使用常规$资源时遇到同样的问题。

我正在使用Angular UI Bootstrap中的工具提示指令。该应用程序是在Ruby on Rails 4.0中构建的,并使用angularjs-rails gem(不稳定)。

我最好的猜测是我的网站上的CSS太复杂了,我需要找到一种方法来在加载后重新处理这些工具提示。

1 个答案:

答案 0 :(得分:0)

我需要在app = angular.module(...)行下面添加:

app.config( function ( $tooltipProvider ) {
  $tooltipProvider.options({appendToBody: true});
});

我不确定这里发生了什么,但它与https://github.com/angular-ui/bootstrap/pull/254有关,也可能与https://github.com/angular-ui/bootstrap/issues/139有关。