-
-
Notifications
You must be signed in to change notification settings - Fork 240
Expand file tree
/
Copy pathnativescript.module.ts
More file actions
30 lines (25 loc) · 1.46 KB
/
Copy pathnativescript.module.ts
File metadata and controls
30 lines (25 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { ApplicationModule, ErrorHandler, NO_ERRORS_SCHEMA, NgModule, RendererFactory2, SystemJsNgModuleLoader, Optional, SkipSelf, ɵINJECTOR_SCOPE } from '@angular/core';
import { ViewportScroller, ɵNullViewportScroller as NullViewportScroller } from '@angular/common';
import { NativeScriptCommonModule } from './common';
import { NativeScriptRendererFactory } from './renderer-factory';
import { DetachedLoader } from './common/detached-loader';
import { throwIfAlreadyLoaded } from './common/utils';
import { FrameService } from './frame.service';
export function errorHandlerFactory() {
return new ErrorHandler();
}
export { DetachedLoader } from './common/detached-loader';
@NgModule({
declarations: [DetachedLoader],
providers: [FrameService, NativeScriptRendererFactory, SystemJsNgModuleLoader, { provide: ɵINJECTOR_SCOPE, useValue: 'root' }, { provide: ErrorHandler, useFactory: errorHandlerFactory }, { provide: RendererFactory2, useExisting: NativeScriptRendererFactory }, { provide: ViewportScroller, useClass: NullViewportScroller }],
entryComponents: [DetachedLoader],
imports: [ApplicationModule, NativeScriptCommonModule],
exports: [ApplicationModule, NativeScriptCommonModule, DetachedLoader],
schemas: [NO_ERRORS_SCHEMA],
})
export class NativeScriptModule {
constructor(@Optional() @SkipSelf() parentModule: NativeScriptModule) {
// Prevents NativeScriptModule from getting imported multiple times
throwIfAlreadyLoaded(parentModule, 'NativeScriptModule');
}
}