<span title="保存"
ng-if="item.$editing"
ng-click="item.$editing=false"
ng-click="save(item)">
</span>
<!-- 上面有两个ng-click,这样写不对,我想在一个ng-click中实现,求解决方法!谢谢!-->
PHPz2017-05-15 17:06:25
<span title="保存"
ng-if="item.$editing"
ng-click="item.$editing=false; save(item)">
</span>
为情所困2017-05-15 17:06:25
Why not put item.$editing=false; inside a function, such as editSave()?
function editSave(item){
item.$editing=false;
save(item);
}
<span title="保存"
ng-if="item.$editing"
ng-click="editSave(item)">
</span>
}
It’s better to put the logic code in the controller