$scope.data="<h2>here we have text boxes and button</h2><button type='button' class='btn btn-primary'>inside Basic</button>"+"<button type='button' class='btn btn-primary'>inside Primary</button>"+" Name inside<input type='text' name='namein' /><br>Age indise :: <input type='text' name='agein' /><br></form>";
<div ng-bind-html="data"></div>
This is the content I have used in ng-bind-html, but, it doesn't display text box and button.I have tried same code in plunker but it did not work there.
You need to add
$sce.trustAsHtml
because a button (like many others elements) is not a trusted element angular can bind without that:JSFiddle
If you need to use Angular function inside the ng-bind-html so you need a directive like this (credits):
HTML:
With
$compile
you can tell to compile the string to be used as HTML written directly in the view.