如何在angular2中使用onchange

时间:2016-11-01 05:52:18

标签: angular typescript

我有<td>可编辑。我想将已编辑的新数据发送到函数中,如何在<td (blur) ='showsavephonemodel(i want the newly edited value here i.e student.phone)' contenteditable="true" class ='phone' > {{student.phone}} </td> 标记中获取数据,任何人都可以帮助我。

sprintf

1 个答案:

答案 0 :(得分:2)

您应该使用(keyup)(blur)事件,

<td (keyup)='showsavephonemodel()' class ='phone'>
     {{student.phone}}  
</td>


<td (blur)='showsavephonemodel()' class ='phone'>
     {{student.phone}}  
</td>