Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy AngularJS Tutorial</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular-sanitize.js"></script> </head> <body> <div ng-app="myApp" ng-controller="ngbindCtrl"> <h3>ng-bind-html Directive example in AngularJS</h3> <p ng-bind="value"></p> <p ng-bind-html="value"></p> </div> <script> var app = angular.module("myApp", ['ngSanitize']); app.controller("ngbindCtrl", function($scope) { $scope.value = "<b>Welcome to</b>" + "<a href= http://www.wikitechy.com/>Wikitechy.com</a>"; }); </script> </body> </html>
www.wikitechy.com © Copyright 2016. All Rights Reserved.