I have an Input like this:
<input type="text" ng-model="name">
and a list which is placed on the scope:
$scope.list = ["<span>{{name}}</span>","<span>{{name2}}</span>"]
I am trying to run over the list using ng-repeat and display all the list element and have a binding between the input and the span content.
<div ng-repeat="item in list" ng-bind-html-unsafe="item">
<span>{{$index + 1}}.</span>
<span ng-bind-html="to_trusted(item)"></span>
</div>
Where:
$scope.to_trusted = function(html_code) {
return $sce.trustAsHtml(html_code);
}
What is the right way to do so? Thanks.
{{name}}
instead of the value ofname
?