0

So I'd like to include large but not complicated html, which just contains 1 variable item which should be inherited from the parent.

Is there some simple way rather than having to create a whole component for it?

<div>Lots of nodes here, not just one, and also some item attributes {{item.url}}</div>

The parent would include this template at several spots.

What is the least amount of syntax required?

PascalVKooten
  • 19,461
  • 15
  • 93
  • 149

1 Answers1

0

how to show parsed HTML with link and variable value.

<div [innerHTML]="myHtml"></div>

export class ParentCmp {

   myVal:string="micronyks";
   myHtml="<a href='http://google.com'>Google.com</a>" + this.myVal + " <p>Long text</p>";

}
micronyks
  • 52,386
  • 15
  • 100
  • 135