diff --git a/nativescript-angular/platform.ts b/nativescript-angular/platform.ts index 66e16ab2f..9194a40a3 100644 --- a/nativescript-angular/platform.ts +++ b/nativescript-angular/platform.ts @@ -1,4 +1,8 @@ -// Always import platform-common first - because polyfills +// Always import reflect-metadata before @angular/core. +// It's needed to handle __metadata calls inside @angular/core +import "reflect-metadata"; + +// Import platform-common immediately after reflect-metadata - because rest of the polyfills. import { NativeScriptPlatformRef, AppOptions, @@ -6,8 +10,6 @@ import { COMMON_PROVIDERS } from "./platform-common"; -import "reflect-metadata"; - import { NSFileSystem } from "./file-system/ns-file-system"; import { @@ -49,7 +51,7 @@ export const NS_COMPILER_PROVIDERS: StaticProvider[] = [ provide: COMPILER_OPTIONS, useValue: { providers: [ - { provide: NSFileSystem, deps: []}, + { provide: NSFileSystem, deps: [] }, { provide: ResourceLoader, useClass: FileSystemResourceLoader, deps: [NSFileSystem] }, { provide: ElementSchemaRegistry, useClass: NativeScriptElementSchemaRegistry, deps: [] }, ]