JSONオブジェクトからhtml要素を埋め込もうとしていますが、現在は代わりにHTMLを生のコードとして表示しています。イオンアプリケーションのJSONオブジェクトからhtml要素を表示
誰かお手伝いできますか?
detail.ts
this.questionsData[i].question_type.title = "<ion-input type=\"text\" placeholder=\"Short answer\"></ion-input>";
detail.html
<ion-item *ngFor="let question of questionsData">
{{question.title}}
<br>
Text : {{question.question_type.title}}
<br>
<div [innerHTML]="question.question_type.title">
</div>
</ion-item>
それはテキストの下の入力ボックスであるべきではない:それはレンダリングされていない理由は、誰もが知っていますか?
おかげ
ホープはのための非常にクリーン、そんなにこのアプローチをありがとう私も使用していますので、テンプレートファイルはtsファイルではなくhtmlファイルで行われます。 – damniatx
これを聞いて嬉しいです:) –