typescript - 在角度 8 中不使用 [(ngModel)] 更新 innerHTML 值
问题描述
I'm getting values dynamically like an array,
[
{"name":"Ram", "email":"Ram@gmail.com"},
{"name":"Bob", "email":"bob32@gmail.com"}
],
using textarea with HTMLtag I inserting the name value, when user click on textarea and if he wants to type some text and if he click on cancel button it should render to previous value.
condition: must not have to use [(ngModel)], we must not have to change anytags, Used keyup to detect change
Not able to revert the change to previous value when user click cancel, must not have to add form as well
<div *ngFor="let emp of employees">
<textare [innerHTML]="emp.name"></textarea>
</div>
<div>
<button (click)="Reset()">Cancel </cancel>
</div>
解决方案
推荐阅读
- julia - 如何用特殊的随机元素制作一个矩阵?
- laravel - Laravel 函数中的混合参数类型
- python - 如何使用我们自己的数据集自定义预训练模型?
- sql-server - 使用本地 Management Studio 连接到在 playwithdocker 上运行的 SQL Server 实例
- c# - 如果页面未显示在框架中,WPF Visualbrush 不会更新
- java - 无法将 Log4j2 AsyncAppender 与 log4j2.properties 一起使用
- javascript - 根据文件名获取附加的formData文件索引
- powershell - 为什么即使打开 -ErrorAction Stop,我的 try catch 错误也会成功传递?
- python - 如何通过 python 连接以太网连接的相机(Flir AX8 相机)
- python - 如何转换 pandas Dataframe 中列的值?