File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -43,23 +43,21 @@ $ npm install @types/plotly.js-dist-min --save-dev
4343
4444## Quick start
4545
46- Add the ` PlotlyModule ` into the main app module of your project
46+ Provide the ` PlotlyModule ` into the appConfig of your project
4747``` typescript
48- import { NgModule } from ' @angular/core' ;
49- import { CommonModule } from ' @angular/common' ;
48+ import {ApplicationConfig , importProvidersFrom } from " @angular/core" ;
5049
5150import * as PlotlyJS from ' plotly.js-dist-min' ;
5251import { PlotlyModule } from ' angular-plotly.js' ;
5352
5453
55- @ NgModule ({
56- imports: [
57- CommonModule ,
58- PlotlyModule .forRoot (PlotlyJS )
54+
55+ export const appConfig : ApplicationConfig = {
56+ providers: [
57+ importProvidersFrom ( PlotlyModule .forRoot (PlotlyJS )),
5958 ],
6059 ...
61- })
62- export class AppModule { }
60+ }
6361```
6462
6563Then use the ` <plotly-plot> ` component to display the graph
You can’t perform that action at this time.
0 commit comments