How to render raw html with AngularJS?
问题 I'm creating an AngularJS single page application. The data will be fetched from a webservice in json -format. The problem is that some text elements come with preformatted html tags json output: { "text": "<p><span style="text-decoration: underline;"><strong>test text</string></span></p>" } Now how can I display this text and render the html directly, so that only "test" is shown to the user and the rest serves as markup? <h1>{{data.text}}</h1> 回答1: You need to add ng-bind-html="data.text"