在角JS和指令表NG-重复 [英] ng-repeat with tables in Angular JS and directives

查看:250
本文介绍了在角JS和指令表NG-重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个敏感的数据表采用了棱角分明带有指令和NG-重复。我曾设法让吴重复使用表格的工作: http://jsfiddle.net/raff77/Asb8k/

I am trying to build a responsive data table using Angular with a directive and ng-repeat. I have managed to get the ng-repeat to work with tables: http://jsfiddle.net/raff77/Asb8k/

{}

我现在正在试图让它与一个指令和NG-重复不起作用工作。 http://jsfiddle.net/raff77/uwGXb/3/

{}

有没有办法让NG重复你的指令工作或你应该建立一个到你的指令。请注意,我已经建立了一个解决方案,以增加行作为字符串然后HTML,但我想避免这种情况,做事情的角度的方式。

Is there a way to get the ng-repeat to work with your directive or should you build that into your directive. Notice I have built out a solution to add the rows as strings then html but i want to avoid this and do things the Angular way.

推荐答案

有似乎是在AngularJS中的错误,当你想将TD的到表的指令。看到这个问题,<一个href=\"http://stackoverflow.com/questions/15754889/angular-directive-does-not-evaluate-inside-ng-repeat\">Angular指令不计算里面NG-重复尤其这样的回答: http://stackoverflow.com/a/15755234/669561
https://github.com/angular/angular.js/issues/1459

There seems to be a bug in AngularJS when you want to put 'td's into a table in a directive. See this question Angular Directive Does Not Evaluate Inside ng-repeat and particularly this answer: http://stackoverflow.com/a/15755234/669561. https://github.com/angular/angular.js/issues/1459

和我真的不明白,你为什么要填写表格中带指令。你不表第一种方法似乎工作完全正常,我看不出使用过任何指令advanteges。

And I don't really see, why you want to fill up the table with a directive. Your first approach without the table seems to work perfectly fine and I cannot see any advanteges over using directives.

这篇关于在角JS和指令表NG-重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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