1

I am retrieve data from JSON and also retrieve some text content but text content not support p tag. I will show you screen shot for hints.
enter image description here

When we retrieved the Text content then it is showing like this(with p tag). JSON URL:

http://www.json-generator.com/api/json/get/bTRWzhCvuG?indent=2

HTML:

<div ng-controller="chooseProductDescription">
      <div ng-repeat="cat in productDescription">
                <div>{{cat.product.fullDescription}} </div>             
       </div>
</div>

CONTROLLER:

.controller('chooseProductDescription', function($scope, $http){
    $http({
        method:'get',
        url:'http://www.json-generator.com/api/json/get/bTRWzhCvuG?indent=2',
        header:{'Content-Type':'application/json'},
    }).success(function(data,status,headers, config){   
        $scope.productDescription = data;       
    }).error(function(data, status,headers, config){

    })
})

When retrieve the content in View page then p tag not support in angular js. What should i do? please let me know. Thanks in advance.

Varun Sharma
  • 4,632
  • 13
  • 49
  • 103

1 Answers1

0

use ngBindHtml

<div ng-controller="chooseProductDescription">
      <div ng-repeat="cat in productDescription">
                <div ng-bind-html="cat.product.fullDescription"></div>             
       </div>
</div>
n00dl3
  • 21,213
  • 7
  • 66
  • 76