I have a couple of modules that I am trying to load at runtime based on some conditions. Currently I am using theocLazyLoad module but I am the loaded module's are not working at all. Everything loads fine, there are no errors being thrown.
I first declare my main module
var app = angular.module('myApp',['oc.lazyLoad'])
app.config(['$ocLazyLoadProvider',function(){
modules : [{
name : 'mod1',
files : [CDN-Path]
}]
}]);
and then somewhere in my controller
app.controller('c',function($ocLazyLoad){
$ocLazyLoad.load('mod1').then(function(){
console.log('module loaded!');
});
})
What I truly do inside the resolved promise is that I register a new state with ui-router, and within that state I use some of the directives defined in mod1
, but they simply don't work. Is there further initialization that must be performed after the module loads?