I have some text which I am fetching from a JSON source which contains placeholders, e.g.
let data = {"one": "click to start ${topic}"}
and it is rendered on an ionic view with:
<h1 [innerHtml]="data.one"></h1>
In the model I have a variable named topic="dinsdale"
, yet the text is rendered literally and no substitution occurs.
Some answers on SO suggest using eval
, but it looks a bit scary. Does ionic have a built-in mechanism for this?