Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

point people to Angular 1.6.7 and $injector.loadNewModules(modules) #411

Open
graingert opened this issue Nov 27, 2017 · 9 comments
Open

Comments

@graingert
Copy link

see angular/angular.js@6e78fee

$injector.loadNewModules(modules)

@graingert
Copy link
Author

@ocombe might be worth deprecating ocLazyLoad?

@Insidexa
Copy link

How to declarate modules in bundleUrl ?
Like a simple angular module or do you need to export this module ?

@graingert
Copy link
Author

graingert commented Dec 10, 2017

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]); });
  };
})

@BusbyActual
Copy link

Is there an implementation of directives for that feature?

@graingert
Copy link
Author

@BusbyActual what?

@BusbyActual
Copy link

You advocated for suggesting this library is deprecated and to suggested to use the $injector.loadNewModules method. How would one load a directive ?

@graingert
Copy link
Author

@BusbyActual you declare the directive in the module you want to load

@BusbyActual
Copy link

BusbyActual commented Oct 3, 2019

@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.

@graingert
Copy link
Author

graingert commented Oct 3, 2019

Just make sure you compile html in loadModule(...).then(moduleName => { /* here */ })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants