棱角分明的UI引导提示不NG-重复显示(节点WebKit的应用程序) [英] Angular-ui Bootstrap tooltips not showing in ng-repeat (node-webkit app)

查看:124
本文介绍了棱角分明的UI引导提示不NG-重复显示(节点WebKit的应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来angular.js和节点WebKit的,而我努力使引导提示在通过NG-重复动态加载的内容合作。

I'm new to angular.js and node-webkit, and I'm struggling to make bootstrap tooltips work in content dynamically loaded via ng-repeat.

首先,我使用标准的引导和尝试做了以下:
http://jsfiddle.net/nsDFe/3/

First, I've tried using standard bootstrap and did the following : http://jsfiddle.net/nsDFe/3/

app.directive('bsTooltip', function () {
    return function (scope, element, attrs) {
        // trying to register the new tooltips
        element.find('span').tooltip();
    };
});

这不工作(但在第一个表行中的正常定义提示的作品)。

And this doesn't work (but the "normally" defined tooltip in the first table row works).

然后我试图采用了棱角分明的用户界面引导,做了以下(认为它应该是一种自动,即角库会听新的DOM元素):
http://jsfiddle.net/XTG8k/2/

Then I tried using angular-ui bootstrap and did the following (thinking it should be kind of "automatic" that the angular library would listen to new dom elements) : http://jsfiddle.net/XTG8k/2/

但没有运气无论是。可能有人点我在正确的方向?我已经看到了关于这个位置#2一些讨论,但没有真正解决我的问题。我听说到$一些模糊的引用编译,但想不出如何实现这一点。

But no luck either. Could someone point me in the right direction ? I've seen some discussions regarding this here on Stackoverflow but none that really solved my problem. I've heard some vague references to $compile but could not figure how to implement that.

推荐答案

我觉得你只是要对这个走错了路,你不应该在加载您动态加载内容的HTML,你应该只装载数据你会把你的HTML模板,然后你可以做到这一点是这样的:

I think you are just going about this the wrong way, you shouldn't be loading html in your dynamically loaded content, you should just be loading the data that you will put in your html template, and then you can do it like this:

http://jsfiddle.net/XTG8k/5/

<tr ng-repeat="foo in bar">
    <td><span tooltip="{{foo.tooltip}}">{{foo.content}}</span></td>
</tr>

这篇关于棱角分明的UI引导提示不NG-重复显示(节点WebKit的应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆