This is an example of my JSON data:
[
{
"Title": "MyTitle1",
"Content": "<p>Content1</p>",
"Date": "2014-11-19T10:00:00"
},
{
"Title": "MyTitle2",
"Content": "<p>Content2</p>",
"Date": "2014-11-19T00:00:00"
}
]
Within my controller, I retrieve the JSON like this:
app.controller('NewsfeedCtrl', function ($scope, $http) {
$http.get(serverAddress + '/api/newsfeed/page/1').
success(function (data, status, headers, config) {
$scope.newsfeeds = data;
}).
error(function (data, status, headers, config) {
console.log("Something went wrong.");
});
});
I then display it in the view like this:
<div ng-controller="NewsfeedCtrl">
<div ng-repeat="newsfeed in newsfeeds">
{{newsfeed.Title}}
<br />-
<br />{{newsfeed.Date}}
<br />-
{{newsfeed.Content}}
</div>
</div>
However, if there are HTML tags within the Content, how can they be properly displayed in the view while also being parsed?