Skip to main content
add ntoe
Source Link

You don't even need Jquery for that. ng-bind-html can do the trick by himself.

<div class="storycontent" ng-class="{show: show}">
  <a href="#/profile?{{review.id}}">{{review.name}}</a>: 
    <span ng-bind-html="review.story"></span>
</div>

Moreover, it's also better to add this on your controller when you get the value. Because without this, ng-bind-hmtl isn't safe.

$scope.review.story = $sce.trustAsHtml($scope.review.story);

Note : $sce have to be injected in your controller. It's not available directly with angularJS.

.controller('ControllerName', ['$scope', '$sce', function($scope, $sce) {... 

You don't even need Jquery for that. ng-bind-html can do the trick by himself.

<div class="storycontent" ng-class="{show: show}">
  <a href="#/profile?{{review.id}}">{{review.name}}</a>: 
    <span ng-bind-html="review.story"></span>
</div>

Moreover, it's also better to add this on your controller when you get the value. Because without this, ng-bind-hmtl isn't safe.

$scope.review.story = $sce.trustAsHtml($scope.review.story);

You don't even need Jquery for that. ng-bind-html can do the trick by himself.

<div class="storycontent" ng-class="{show: show}">
  <a href="#/profile?{{review.id}}">{{review.name}}</a>: 
    <span ng-bind-html="review.story"></span>
</div>

Moreover, it's also better to add this on your controller when you get the value. Because without this, ng-bind-hmtl isn't safe.

$scope.review.story = $sce.trustAsHtml($scope.review.story);

Note : $sce have to be injected in your controller. It's not available directly with angularJS.

.controller('ControllerName', ['$scope', '$sce', function($scope, $sce) {... 
Source Link

You don't even need Jquery for that. ng-bind-html can do the trick by himself.

<div class="storycontent" ng-class="{show: show}">
  <a href="#/profile?{{review.id}}">{{review.name}}</a>: 
    <span ng-bind-html="review.story"></span>
</div>

Moreover, it's also better to add this on your controller when you get the value. Because without this, ng-bind-hmtl isn't safe.

$scope.review.story = $sce.trustAsHtml($scope.review.story);