AngularJS - 从更改事件表中行的第一列获取值

时间:2017-09-13 19:19:31

标签: angularjs angularjs-ng-repeat angularjs-ng-change

请参阅演示此问题的plunker here

我希望在更改任何值时显示任何给定行的相应英文值(第一列)。例如' Uploaded'当第二个上的任何值发生变化时,应始终在弹出窗口中显示。

我在示例中已经取得了这么远,但并不完全存在:

<textarea ng-model="res.Value"
          ng-change="vm.changed(vm.resourceGridResources.Resources[$index].Resources[0].Value)"
          style="min-width: 300px"></textarea>

1 个答案:

答案 0 :(得分:2)

以你的例子为例。 不要使用$index,而是使用$parent.$index。 它将引用之前$index的{​​{1}}。

ng-repeat

Corrected plunkr