ocLazyLoad
ocLazyLoad copied to clipboard
point people to Angular 1.6.7 and $injector.loadNewModules(modules)
see https://github.com/angular/angular.js/commit/6e78fee73258bb0ae36414f9db2e8734273e481b
@ocombe might be worth deprecating ocLazyLoad?
How to declarate modules in bundleUrl ? Like a simple angular module or do you need to export this module ?
app.factory('loadModule', function($injector, $q) {
return function loadModule(moduleName, bundleUrl) {
return $q.resolve(import('./path/to/es/module')).then(function(v) { $injector.loadNewModules([v.default]); });
};
})
Is there an implementation of directives for that feature?
@BusbyActual what?
You advocated for suggesting this library is deprecated and to suggested to use the $injector.loadNewModules method. How would one load a directive ?
@BusbyActual you declare the directive in the module you want to load
@graingert
Previously compiled HTML will not be affected by newly loaded directives, filters and components.
If I'm reading this correctly directives will still be an issue.
Just make sure you compile html in loadModule(...).then(moduleName => { /* here */ })