In a previous topic a solution was given to use ng-model inside of generated code. The solution was to implement a custom directive:
app.directive('compile',function($compile, $timeout){
return{
restrict:'A',
link: function(scope,elem,attrs){
$timeout(function(){
$compile(elem.contents())(scope);
});
}
};
});
And to use it like an attribute:
<div compile class="options" ng-bind-html="item.options"></div>
I'm trying to obtain the same result using the "controller as" syntax but I couldn't find a way to do it. In my controller I don't want to use $scope as in Angular 2.0 there won't be any.