diff --git a/src/lazyLoad/lazyLoadNgModule.ts b/src/lazyLoad/lazyLoadNgModule.ts index 8ba4f7490..e4d362ac1 100644 --- a/src/lazyLoad/lazyLoadNgModule.ts +++ b/src/lazyLoad/lazyLoadNgModule.ts @@ -1,4 +1,4 @@ -import { NgModuleRef, Injector, NgModuleFactory, Type, Compiler, NgModuleFactoryLoader } from '@angular/core'; +import { NgModuleRef, Injector, NgModuleFactory, Type, Compiler } from '@angular/core'; import { Transition, LazyLoadResult, @@ -84,10 +84,6 @@ export function loadNgModule( /** * Returns the module factory that can be used to instantiate a module * - * For strings this: - * - Finds the correct NgModuleFactoryLoader - * - Loads the new NgModuleFactory from the path string (async) - * * For a Type or Promise> this: * - Compiles the component type (if not running with AOT) * - Returns the NgModuleFactory resulting from compilation (or direct loading if using AOT) as a Promise @@ -98,10 +94,6 @@ export function loadModuleFactory( moduleToLoad: ModuleTypeCallback, ng2Injector: Injector ): Promise> { - if (isString(moduleToLoad)) { - return ng2Injector.get(NgModuleFactoryLoader).load(moduleToLoad); - } - const compiler: Compiler = ng2Injector.get(Compiler); const unwrapEsModuleDefault = (x) => (x && x.__esModule && x['default'] ? x['default'] : x); diff --git a/test-angular-versions/v10/src/app/app.module.ts b/test-angular-versions/v10/src/app/app.module.ts index 625a33fef..214cd701f 100644 --- a/test-angular-versions/v10/src/app/app.module.ts +++ b/test-angular-versions/v10/src/app/app.module.ts @@ -1,5 +1,5 @@ import { BrowserModule } from '@angular/platform-browser'; -import { NgModule, NgModuleFactoryLoader, SystemJsNgModuleLoader } from '@angular/core'; +import { NgModule } from '@angular/core'; import { UIRouterModule } from '@uirouter/angular'; import { UIRouter } from '@uirouter/core'; @@ -19,7 +19,6 @@ export function config(router: UIRouter) { @NgModule({ imports: [BrowserModule, UIRouterModule.forRoot({ states, config })], - providers: [{ provide: NgModuleFactoryLoader, useClass: SystemJsNgModuleLoader }], declarations: [AppComponent, HomeComponent, AboutComponent], bootstrap: [AppComponent], }) diff --git a/test-angular-versions/v11/src/app/app.module.ts b/test-angular-versions/v11/src/app/app.module.ts index 625a33fef..214cd701f 100644 --- a/test-angular-versions/v11/src/app/app.module.ts +++ b/test-angular-versions/v11/src/app/app.module.ts @@ -1,5 +1,5 @@ import { BrowserModule } from '@angular/platform-browser'; -import { NgModule, NgModuleFactoryLoader, SystemJsNgModuleLoader } from '@angular/core'; +import { NgModule } from '@angular/core'; import { UIRouterModule } from '@uirouter/angular'; import { UIRouter } from '@uirouter/core'; @@ -19,7 +19,6 @@ export function config(router: UIRouter) { @NgModule({ imports: [BrowserModule, UIRouterModule.forRoot({ states, config })], - providers: [{ provide: NgModuleFactoryLoader, useClass: SystemJsNgModuleLoader }], declarations: [AppComponent, HomeComponent, AboutComponent], bootstrap: [AppComponent], }) diff --git a/test/ngModule/deferInitialRender.spec.ts b/test/ngModule/deferInitialRender.spec.ts index 965c3ecb3..43f599138 100644 --- a/test/ngModule/deferInitialRender.spec.ts +++ b/test/ngModule/deferInitialRender.spec.ts @@ -6,8 +6,6 @@ import { APP_INITIALIZER, ApplicationInitStatus, Component, - NgModuleFactoryLoader, - SystemJsNgModuleLoader, } from '@angular/core'; import { Ng2StateDeclaration } from '../../src/interface'; @@ -43,7 +41,6 @@ const setupTests = (deferInitialRender: boolean) => { declarations: [HomeComponent, AppComponent], imports: [routerModule], providers: [ - { provide: NgModuleFactoryLoader, useClass: SystemJsNgModuleLoader }, { provide: APP_INITIALIZER, useValue: () => appInitializer, multi: true }, ], }); diff --git a/test/ngModule/lazyModule.spec.ts b/test/ngModule/lazyModule.spec.ts index 426dfe139..1144950c8 100644 --- a/test/ngModule/lazyModule.spec.ts +++ b/test/ngModule/lazyModule.spec.ts @@ -2,7 +2,6 @@ import { async, inject, TestBed } from '@angular/core/testing'; import { UIRouterModule } from '../../src/uiRouterNgModule'; import { UIView } from '../../src/directives/uiView'; import { memoryLocationPlugin, UIRouter } from '@uirouter/core'; -import { NgModuleFactoryLoader, SystemJsNgModuleLoader } from '@angular/core'; declare let System; @@ -40,7 +39,6 @@ describe('lazy loading', () => { TestBed.configureTestingModule({ declarations: [], imports: [routerModule], - providers: [{ provide: NgModuleFactoryLoader, useClass: SystemJsNgModuleLoader }], }); });