I need some help with an ng-model created with ng-bind-html. I have a JSON file in the server in which I have some html and some inputs like this:
*.json
<
javascript:
app.controller('demoController', function($rootScope, $scope, $http, $compile){
var arr = [
'I am an HTML
string with links! and other stuff'
,'name: '
,'age: '];
$scope.user={};
$scope.testChange2 = function(){
var compileFn = $compile( arr[Number.parseInt(Math.random()*10)%3] );
var $dom = compileFn($scope);
$('#test').html($dom);
};
});
html:
user:{{user}}