55 * Use of this source code is governed by an MIT-style license that can be
66 * found in the LICENSE file at https://angular.io/license
77 */
8- import { Type , NgModuleFactory , CompilerFactory , Compiler , StaticProvider } from '@angular/core' ;
9- import { platformDynamicServer } from '@angular/platform-server' ;
108import { DOCUMENT } from '@angular/common' ;
119import { ResourceLoader } from '@angular/compiler' ;
10+ import { Compiler , CompilerFactory , NgModuleFactory , StaticProvider , Type } from '@angular/core' ;
11+ import { platformDynamicServer } from '@angular/platform-server' ;
1212
13- import { REQUEST , ORIGIN_URL } from '@nguniversal/aspnetcore-engine/tokens' ;
13+ import { ORIGIN_URL , REQUEST } from '@nguniversal/aspnetcore-engine/tokens' ;
1414import { FileLoader } from './file-loader' ;
1515import { IEngineOptions } from './interfaces/engine-options' ;
1616import { IEngineRenderResult } from './interfaces/engine-render-result' ;
@@ -37,7 +37,9 @@ function _getUniversalData(doc: Document): UniversalData {
3737 const META : string [ ] = [ ] ;
3838 const LINKS : string [ ] = [ ] ;
3939
40+ // tslint:disable-next-line: no-non-null-assertion
4041 for ( let i = 0 ; i < doc . head ! . children . length ; i ++ ) {
42+ // tslint:disable-next-line: no-non-null-assertion
4143 const element = doc . head ! . children [ i ] ;
4244 const tagName = element . tagName . toUpperCase ( ) ;
4345
@@ -83,6 +85,7 @@ function _getUniversalData(doc: Document): UniversalData {
8385
8486 return {
8587 title : doc . title ,
88+ // tslint:disable-next-line: no-non-null-assertion
8689 appNode : doc . querySelector ( appSelector ) ! . outerHTML ,
8790 scripts : SCRIPTS . join ( '\n' ) ,
8891 styles : STYLES . join ( '\n' ) ,
@@ -158,6 +161,7 @@ function getReqResProviders(origin: string, request: string): StaticProvider[] {
158161 useValue : request
159162 }
160163 ] ;
164+
161165 return providers ;
162166}
163167
@@ -170,7 +174,7 @@ async function getFactory(
170174 if ( moduleOrFactory instanceof NgModuleFactory ) {
171175 return moduleOrFactory ;
172176 } else {
173- let moduleFactory = factoryCacheMap . get ( moduleOrFactory ) ;
177+ const moduleFactory = factoryCacheMap . get ( moduleOrFactory ) ;
174178 // If module factory is cached
175179 if ( moduleFactory ) {
176180 return moduleFactory ;
@@ -179,6 +183,7 @@ async function getFactory(
179183 // Compile the module and cache it
180184 const factory = await compiler . compileModuleAsync ( moduleOrFactory ) ;
181185 factoryCacheMap . set ( moduleOrFactory , factory ) ;
186+
182187 return factory ;
183188 }
184189}
0 commit comments