Can we use oclazyload in controller level other than resolve? If so in what scenarios we can use oclazyload in controller other than directives?

61 views Asked by At

Something like this which i found in oclazyload example

angular.module("LazyLoadTest", ["oc.lazyLoad"])
            .controller("TestController", function($scope, $ocLazyLoad, $compile) {
                $ocLazyLoad.load("js/testApp.js").then(function() {
                    console.log('loaded!!');
                    var el, elToAppend;
                    elToAppend = $compile('<say-hello to="world"></say-hello>')($scope);
                    el = angular.element('#example');
                    el.append(elToAppend);
                }, function(e) {
                    console.log('errr');
                    console.error(e);
                })
            });
0

There are 0 answers