I have an array of objects like this
Heros=[{
heroName:"card1",
heroType:"type1",
heroHtml:"<p>card 1</p>"
},
{
heroName:"card2",
heroType:"type2",
heroHtml:"<p>card 2</p>"
}
]
and I want to display it on my html page for example
<div *ng-for="#hero of heros" data-hero-type="hero.heroType" [inner-html]="hero.heroHtml"></div>
here you can see Plunker .
why cannot the data-data type get the correct value? If it is forbidden or not recommended, what other solution can be used to bind the value to the html 5 user attribute?
source
share