【发布时间】:2013-11-14 16:03:30
【问题描述】:
代码如下:
tr.row(ng-class="{editing: is_dirty(p)}" ng-repeat="p in persons")
td {{p.name}}
td {{p.surname}}
if is_dirty(p)
button.action Save
else
button.action Edit
button.action Delete
我从我的界面开始,将尝试实现一些内联编辑。因此,第一步是列出所有人员,然后单击添加新行。现在,一个新行应该只有保存按钮,现有行应该有一个编辑和一个删除按钮。
上面的代码不起作用(使用jade、express、node和angular)。
我看过ng-switch 和ng-if,但它们对我来说看起来过于复杂,如果不是这样的话......
【问题讨论】:
标签: javascript angularjs pug ng-repeat