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 { APP_INITIALIZER, Injector, ModuleWithProviders, NgModule } from '@angular/core'; |
|||
import { NgModule } from '@angular/core'; |
|||
import { ChartComponent } from './chart.component'; |
|||
|
|||
declare const Chart: any |
|||
|
|||
@NgModule({ |
|||
imports: [CommonModule], |
|||
exports: [ChartComponent], |
|||
declarations: [ChartComponent], |
|||
providers: [], |
|||
imports: [CommonModule], |
|||
exports: [ChartComponent], |
|||
declarations: [ChartComponent], |
|||
providers: [], |
|||
}) |
|||
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] |
|||
}] |
|||
} |
|||
} |
|||
} |
|||
export class ChartModule {} |
|||
|
|||
Loading…
Reference in new issue