Skip to content

Commit 9a3fec2

Browse files
committed
Update README for Angular 20 providers
1 parent 463638f commit 9a3fec2

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff 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

5150
import * as PlotlyJS from 'plotly.js-dist-min';
5251
import { 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

6563
Then use the `<plotly-plot>` component to display the graph

0 commit comments

Comments
 (0)