AngularJS

  • I always post small example of AngularJS function, In this example we learn how to render our HTML code in ng-repeat using trustashtml filter.
  • filter as like bellow you can see code of that filter using $sce.trustAsHtml.
  • So in the example i created one filter for this task using sce trustashtml.
  • $scope.data = [ {title:’Title 1′, description:’

    Test for it

    ‘}, {title:’Title 2′, description:’Here is bold‘}, {title:’Title 3′, description:’It is normal’}, ];

  • Sometimes we have array or object of records with html values, at that time we require to use ng-repeat, But we can’t simple way render html code, we should require to use trustashtml or ng-bind-html-unsafe etc.

angularjs render html code with variable, angularjs trustashtml filter,angularjs trustashtml ng-repeat example, angularjs sce trustashtml example, angular ng-bind-html-unsafe not working, ng-bind-html ng-repeat

@itsolutionstuff: AngularJS – How to render HTML value in ng-repeat ?

I always post small example of AngularJS function, In this example we learn how to render our HTML code in ng-repeat using trustashtml filter.

Sometimes we have array or object of records with html values, at that time we require to use ng-repeat, But we can’t simple way render html code, we should require to use trustashtml or ng-bind-html-unsafe etc. So in this example i created one filter for this task using sce trustashtml. filter as like bellow you can see code of that filter using $sce.trustAsHtml.

I will give you full example of render html code in ng-repeat using bellow angular filter, so let’s see bellow example:

var app = angular.module(“mainApp”, []);

AngularJS