I get my article from database as json object. in this json I have my article data like title and body. I can show it in html page by {{title}} but my problem is about body. body contain HTML codes but the angular show it as string between 2 quotation. How can I solve it?
Angular controller code:
myApp.controller("articlePageController" , function($scope , $http ,$location , $routeParams){
$http.get("/getArticle")
.success(function(data) {
$scope.body = data["article"]["body"];
$scope.title = data["article"]["title"];
})
.error(function(data){
console.log("no");
$scope.currentArticle = data;
});
});
Html view:
<h2>{{title}}</h2>
<p>{{body}}</p>
result:
<p><iframe src="https://www.youtube.com/embed/9aOuF0-1KKY" width="560" height="315" frameborder="0" allowfullscreen=""></iframe></p>
the html code in result does not work as html code result image: enter image description here enter image description here