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
43
43
44
44
## Quick start
45
45
46
- Add the ` PlotlyModule ` into the main app module of your project
46
+ Provide the ` PlotlyModule ` into the appConfig of your project
47
47
``` typescript
48
- import { NgModule } from ' @angular/core' ;
49
- import { CommonModule } from ' @angular/common' ;
48
+ import {ApplicationConfig , importProvidersFrom } from " @angular/core" ;
50
49
51
50
import * as PlotlyJS from ' plotly.js-dist-min' ;
52
51
import { PlotlyModule } from ' angular-plotly.js' ;
53
52
54
53
55
- @ NgModule ({
56
- imports: [
57
- CommonModule ,
58
- PlotlyModule .forRoot (PlotlyJS )
54
+
55
+ export const appConfig : ApplicationConfig = {
56
+ providers: [
57
+ importProvidersFrom ( PlotlyModule .forRoot (PlotlyJS )),
59
58
],
60
59
...
61
- })
62
- export class AppModule { }
60
+ }
63
61
```
64
62
65
63
Then use the ` <plotly-plot> ` component to display the graph
You can’t perform that action at this time.
0 commit comments