mirror of https://github.com/abpframework/abp.git
3 changed files with 14 additions and 37 deletions
@ -1,30 +1,11 @@ |
|||||
import { CommonModule } from '@angular/common'; |
import { CommonModule } from '@angular/common'; |
||||
import { APP_INITIALIZER, Injector, ModuleWithProviders, NgModule } from '@angular/core'; |
import { NgModule } from '@angular/core'; |
||||
import { ChartComponent } from './chart.component'; |
import { ChartComponent } from './chart.component'; |
||||
|
|
||||
declare const Chart: any |
|
||||
|
|
||||
@NgModule({ |
@NgModule({ |
||||
imports: [CommonModule], |
imports: [CommonModule], |
||||
exports: [ChartComponent], |
exports: [ChartComponent], |
||||
declarations: [ChartComponent], |
declarations: [ChartComponent], |
||||
providers: [], |
providers: [], |
||||
}) |
}) |
||||
export class ChartModule { |
export class ChartModule {} |
||||
static forRoot(): ModuleWithProviders<ChartModule> { |
|
||||
return { |
|
||||
ngModule: ChartModule, |
|
||||
providers: [{ |
|
||||
provide: APP_INITIALIZER, |
|
||||
multi: true, |
|
||||
useFactory: (injector: Injector) => () => { |
|
||||
import('chart.js/auto').then((module) => { |
|
||||
console.dir(module) |
|
||||
}) |
|
||||
return Promise.resolve() |
|
||||
}, |
|
||||
deps: [Injector] |
|
||||
}] |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|||||
Loading…
Reference in new issue