我很难找到一种方法来提取 [(ngModel)] 中设置的模型名称。
[(ngModel)]="subjectPropertyInformation.siteSize"
我不需要这个值,而是模型名称,它是字符串“subjectPropertyInformation.siteSize”。我打算在 (change) 指令上传递这个字符串。
有人能帮我吗?提前致谢。
试试这个,比如使用单向绑定。
<input [ngModel]="subjectPropertyInformation.siteSize"
(change)="onChange($event)">
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句