TypeScript - Append HTML to container element in Angular 2

后端 未结 5 715
鱼传尺愫
鱼传尺愫 2020-12-04 14:39

What I want to do, is simply append some html on an element. I checked some links, and i find different confusing/non-working/non-recomended/etc solutions.

Using jav

5条回答
  •  眼角桃花
    2020-12-04 15:05

    You could do something like this:

    htmlComponent.ts

    htmlVariable: string = "Some html."; //this is html in TypeScript code that you need to display

    htmlComponent.html

    //this is how you display html code from TypeScript in your html

提交回复
热议问题