I am inject html inputs from the controller and I am trying to bind the scope variables but its not working.
Here is my code
HTML :
<div ng-controller='addHTML'>
<div ng-bind-html="trustedHtml"></div>
<code>{{user}}</code>
</div>
CSS :
var app = angular.module('app',[]);
var addHTML = function ($scope,$sce) {
$scope.user = {};
$scope.user.someVariable = "";
//inject some html
$scope.html = '<input type="text" ng-model="user.someVariable">';
$scope.trustedHtml = $sce.trustAsHtml($scope.html);
};
You can find it on the fiddle here : http://jsbin.com/miluguni/1/watch?html,js,output
When typing in the input the scope variables isn't changed.
$compileservice first.