Nurul Alam Anik Nurul Alam Anik - 1 year ago 86
AngularJS Question

AngularJS data bind shows html

When i attach a scope variable to a div it displays html tags. Trying to solve it.


$scope.homeBox =[$item];

<div ng-bind="homeBox" ng-bind-html="myService.body | limitTo: limit"></div>

This displays following
enter image description here

Answer Source

Use ng-bind-html if you have to bind html

<div ng-bind-html="homeBox" ng-bind-html="myService.body | limitTo: limit"></div>

But you cannot have two ng-bind-html in one tag. First one will dominate. So better use separate div for both.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download