我得到了以下角度模板:
<tr ng-repeat="user in users">
<td><input type="checkbox"></td>
<td>{{user.username}}</td>
<td>{{user.apiKey}}</td>
<td>{{user.apiSecret}}</td>
</tr>
...
<button type="button" class="btn btn-danger"><i class="fa fa-trash-o"></i></button>
Run Code Online (Sandbox Code Playgroud)
如果没有选中复选框,如何禁用按钮,但在选中表中的一个或多个复选框时启用它?
以及如何确定检查了哪个表条目并访问用户数据?
为什么要以更短的方式做到这一点?我想到了类似的东西void DoSth(int i) : DoSth(i, this);.
class Foo
{
void DoSth(int i)
{
DoSth(i, this);
}
static void DoSth(int i, Foo foo)
{
// do sth
}
}
Run Code Online (Sandbox Code Playgroud)
编辑:忘static了第二个功能