Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. this.loader.load('path-to-module')
  2. .then(factory => {
  3. const module = factory.create(this._injector);
  4. return module.injector.get(EntryService);
  5. });
  6.  
  7. import('path-to-module')
  8. .then(m => m.MyModule)
  9. .then(myModule => {
  10. ...
  11. });
  12.  
  13. import('path-to-module')
  14. .then(m => m.MyModule)
  15. .then(myModule => {
  16. return this._compiler.compileModuleAsync(myModule)
  17. .then(factory => {
  18. const module = factory.create(this._injector);
  19. return module.injector.get(EntryService);
  20. });
  21. });
  22.  
  23. import('path-to-module')
  24. .then(m => m.MyModule)
  25. .then(myModule => {
  26. const providers = myModule['ngInjectorDef'].providers; // Array<Providers>
  27. ... find EntryService in providers
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement