javascript - Text not wrapping in p tag from Json text file.(Angular Js) -
this question has answer here:
- how render html angular templates 4 answers
i retrieve data json , retrieve text content text content not support p tag. show screen shot hints.
when retrieved text content showing 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 content in view page p tag not support in angular js. should do? please let me know. in advance.
use ngbindhtml
<div ng-controller="chooseproductdescription"> <div ng-repeat="cat in productdescription"> <div ng-bind-html="cat.product.fulldescription"></div> </div> </div>
Comments
Post a Comment