{{item.htmlTAG}} raw element?


#1

Hello,

I would like to have an HTML tag as a parameter:
item.htmlTAG = <div class="test"></div>
and then output these as real HTML tag, but i alwasy get an string
this is the output i get:
"<div class="test"></div>"


#2

you have to set it as [innerHTML] of a parent


#3

but i have no parent element…
my code look like this:
`<div *ngFor=“let item of items”>

{{item.title}}

{{item.subtilte}}

{{item.htmlTAG}}
`

is there another way?


#4

maybe

<template [innerHTML]="item.htmlTAG"></template>

?


#5

Unfortunately, this option does not work either
I always get this error: [ERROR ->]<template [innerHTML]="item.htmlTAG"></template>

But thank you for your help