having a json set of information like
[
{
"title":"Title 1",
"description":"<p>Some HTML</p>"
},
{
"title":"Title 2",
"description":"<p>Some HTML</p><p>More HTML</p>"
}
]
how do I show the html in my template. Currently the html is not decoded. I tried with the code below but it doesn't work.
{{item.title}}
<div data-ng-bind-html='item.description'></div>
Controller looks like
var searchApp = angular.module('searchApp', ['ngSanitize']);
searchApp.controller('SearchCtrl', function ($scope, $http) {
$http.get('search-json').success(function(json) {
$scope.item = json.data;
$scope.orderProp = 'title';
});
});
Thank you
Some HTML
instead of the html – orbitory Jul 26 '14 at 14:08