In this example, We are going to create an anchor , an image and span text from angular object. Here is the html
See the output:
<!DOCTYPE html> <html xmlns=""> <head> <title></title> <script src=""></script> <script src=""></script> <style> .showTags { border: 1px solid black; padding: 5px; width: 150px; border-radius: 3px; color: tomato; text-align: center; } .showTags span { font-size: 12px; color: blue; } </style> </head> <body ng-app="myApp"> <div ng-controller="myController"> <div class="showTags" ng-repeat="ex in examples"> <div ng-bind-html=""></div> <span>{{ex.msg}}</span> </div> </div> <script> var app = angular.module("myApp", ['ngSanitize']); app.controller('myController', ['$scope', function ($scope) { $scope.examples = [{ name: "<a href=''>LeartIt</a>", msg: "this is an anchor tag" }, { name: "<img src=''/>", msg: "this is an image tag" }, { name: "Welcome to the world of AngularJS!", msg: "this is just plain text" }]; }]); </script> </body> </html>