Example (DOM):
<div *ngFor="let item of items">
<span [innerHtml]="item"></span>
</div>
Example (Controller):
let items = [];
let timer = 60;
setInterval(() => timer--, 1000);
items.push("This is a dynamic selection WITH a countdown: {{timer}}");
items.push("This is a static selection WITHOUT a timer");
In this scenario, an array "items" is dynamically populated with strings, some containing countdown timers and others not. Is there a way to pass a model into the DOM via a string as demonstrated above and have the timer update accordingly? If so, how can this be achieved?
I truly hope this isn't one of those tricky situations that seems obvious in hindsight.
Thank you