The essence of this problem is: V-repeat will produce sub-scope, when you take the value in the controller, the equivalent of the parent scope to take sub-scope of the value, because the scope in the angular.js is looked up, so cannot be taken.
The operation process is as follows:
The relevant code is as follows:
<Table> <TR> <th>Serial number</th><th>Name</th><th>Wages</th><th>Operation</th> </TR> <TR> <TD>{{$index +1}}</TD> <TD>{{Item.name}}</TD> <TD><inputname= "Salary"Ng-model= "Salary" /></TD> <TD><ButtonNg-click= "Myalert ()">Pop-up pay</Button></TD> </TR></Table><Script>Qrylistctrl. $inject= ['$scope', '$remote']; functionQrylistctrl ($scope, $remote) {$scope. Myalert= function() {alert ($scope. Salary); } }</Script>
Workaround:
<Table> <TR> <th>Serial number</th><th>Name</th><th>Wages</th><th>Operation</th> </TR> <TR> <TD>{{$index +1}}</TD> <TD>{{Item.name}}</TD> <TD><inputname= "Salary"Ng-model= "$parent. Salary" /></TD> <TD><ButtonNg-click= "Myalert ()">Pop-up pay</Button></TD> </TR></Table>
Principle: The value in scope is passed to the parent scope by $parent attribute.
Angular the value of the variable in Ng-repeat ng-if in the controller