Javascript string to html template in Ionic 2


I want to get a javascript string that is created in app.js into a text in my side menu in app.html.

I tried inserting {{ mystring }} in the text, but it doesn’t work. Can you help me? Thanks in advance.


Would something like this do what you want?

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


Thank you for your reply. It would work, but the problem was, that my string was not right initializied. After solving this, my first try with {{ mystring }} is working too.


What your problem? Use the variables from an another scope? Save the variable to a service.
Or from parent scope? Then you would like to use the object sharing: strings.mystring


Thanks, but I have no problem anymore. It’s solved.