【发布时间】:2015-12-03 15:27:09
【问题描述】:
我正在尝试在表格内使用 ng-click,但它不工作,但在表格外它工作正常。
下面是 HTML
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Section</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="product in products">
<td>{{product.ID}}</td>
<td>{{product.Name}}</td>
<td>{{product.Section}}</td>
<td><input type="button" name="name" value="Delete" class="btn btn-danger" ng-click="deleteProduct({{product.ID}});" /></td>
</tr>
</tbody>
</table>
点击Delete按钮deleteProduct方法不调用。
【问题讨论】:
-
您是否尝试过在互联网上搜索 ng-repeat 创建子作用域?
标签: html angularjs angularjs-ng-click