Skip to content

fix: Import reflect-metadata(needed in JIT mode) before @angular #1530

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

Merged
merged 2 commits into from
Sep 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions nativescript-angular/platform.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// 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,
PlatformFactory,
COMMON_PROVIDERS
} from "./platform-common";

import "reflect-metadata";

import { NSFileSystem } from "./file-system/ns-file-system";

import {
Expand Down Expand Up @@ -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: [] },
]
Expand Down