I have the following app:
$scope.things = [{
title: 'my title #1', html: '<input type="text" ng-model="name" />
}, {
title: 'my title #2', html: '<input type="text" ng-model="name" />
}]
And on my HTML:
<div class="block" ng-repeat="t in things track by $index">
<h2>{{t.title}}</h2>
<div class="html" ng-bind-html="t.html | unsafe"></div>
</div>
Where I bind my HTML using the unsafe filter:
angular.module('app').filter('unsafe', function($sce) { return $sce.trustAsHtml; });
The problem I have its that ng-model="name" its not working, if I bind the model to a view nothing happends, its not showing.
Can someone explain me how to 'compile' the t.html
in order to make use of the ng-model
?