我得到了一个有两个ng重复的树状桌子。带参数ngClick不通过参数
<table>
<tr ng-repeat-start="am in anArray">
<td><button ng-click="TheFunction(am)"></button></td>
</tr>
<tr ng-repeat-start="em in anotherArray">
<td><button ng-click="TheFunction2(em)"></button></td>
</tr>
<tr ng-repeat-end></tr>
<tr ng-repeat-end></tr>
对于某些功能来显示/隐藏的“正确”线在屏幕上显示的结果是用具有一个按钮的每一行中调用的范围限定的功能的树。 在控制器I中定义的功能:
$scope.TheFunction=function(am){
alert(am); //and other things to do with the am object
}
$scope.TheFunction2=function(em){
alert(em); //and other things to do with the am object
}
如果我运行的页面,树状构建体如预期工作,所有的按钮被示出。如果我点击一个按钮,就会调用正确的函数。但是,当我检查传递的参数时,它是未定义的。
有什么我错过了吗?
为什么不用NG重复和摆脱NG-重复端行的? –
我使用开始/结束语法来使它更容易阅读(至少对我来说),它不应该影响我认为的参数传递? – Myko
无法重现[JSF上的此DEMO](https://jsfiddle.net/m3wtdsnL/)的问题。 – georgeawg