This is very simple example of the ng-bind-html
directive. In this example we used html tags in the $scope.myHTML
variables's value, as the html word is in bold tag and the word url is anchor tag. We bind the $scope.myHTML
variable with the ng-bind-html
directive. This directive makes the html word bold and url as a anchor tag. ngSanitize
dependency is required to work with ng-bind-html
directive and to get output as html you need to make the html as trusted html. See the example.