Search code examples
angulartypescriptionic-frameworkionic2href

Want to make my angular expression work as link


<a href= "" style="color: #666; ">{{postMessage}}</a>

I am getting {{postMessage}} as angular expression, and this post message is in the form of link , for eg. www.google.com .
If i don't include href then it is displayed as normal text. if I make href="" then it takes me to a blank page, which is obvious. Please help me over the issue that how can I make my angular2 expression work as link in html.


Solution

  • <a [href]="postMessage" style="color: #666; ">{{postMessage}}</a>