1

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.

Community
  • 1
  • 1
Aquila
  • 23
  • 3
  • 2
    can you explain what you mean: _I'm trying to obtain the same result using the "controller as" syntax_? – Grundy Sep 04 '15 at 09:16

0 Answers0