I have created an list with Multiline text column. I am adding some text and some HTML. Once I read the value from text in angular js, and print it on screen, the HTML block written in the column is also rendered as text and not HTML.

How can I achieve this?

For reference: Value inside multiline column is :

This is the video 
<video src=""></video>

You need to use Angular's ng-bind-html directive.

In the html, it would be something like : <span ng-bind-html="item.Description"></span>

In your controller, you need to set the value of description as below:

Description: $sce.trustAsHtml(data.Description)

In your controller, also ensure that $sce is present as below:

myApp.controller('MyController', ['$sce', function($sce) {
    // ... [your code]

Reference - ngBindHtml

$sce - Strict Contextual Escaping

use $sce.trustAsHtml(string) to replicate ng-bind-html-unsafe in Angular

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.