[英]ngModel innerHTML works in p tag but not in input tag angular2
在我的一個angular2應用程序中,我想在輸入字段中顯示模型的innerHTML,其中附有一個模型。
<input type="text" [(ngModel)]="studentCategory" [innerHTML]="studentCategory"/>
studentCategory的值來自數據庫,其中有一些'&#174;' 值。 它直接顯示在文本框中,而應顯示寄存器符號
我可以通過以下方式輕松展示這一點
<p [innerHTML]="studentCategory"/></p>
但不是在有模型附加的輸入中。
提前致謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.