I have the following code:
<div case-editor>        
 </div>    

and directive:
prismDirectives.directive("caseEditor", function ($templateRequest, 
$compile, $controller, $rootScope) {
    return {
        link: function (scope, elem, attrs) {
            $templateRequest("template.html").then(function (html) {
                var template = angular.element(html);
                $(elem).append(template);
                template = $compile(template)(scope);
            });
        }
    };
})

template:
<span ng-controller="aController" ng-bind="test"></span>

controller:

app.controller('aController', function () {
   $scope.test = '123456';}

No data is shown.

So my question is: how do we dynamically load templates and have their 
controllers actually being loaded?

Mine is not even loaded.


Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to