Skip to content

Commit b855411

Browse files
author
fischor
committed
Exports PlotlyService within static forRoot() method.
1 parent 12f16c5 commit b855411

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/app/plotly/plotly.module.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
import { NgModule } from '@angular/core';
2-
import { CommonModule } from '@angular/common';
1+
import { NgModule, ModuleWithProviders } from "@angular/core";
2+
import { CommonModule } from "@angular/common";
33

4-
import { PlotComponent } from './plot/plot.component';
4+
import { PlotComponent } from "./plot/plot.component";
5+
import { PlotlyService } from "./plotly.service";
56

67
@NgModule({
78
imports: [CommonModule],
89
declarations: [PlotComponent],
9-
exports: [PlotComponent],
10+
exports: [PlotComponent]
1011
})
1112
export class PlotlyModule {
12-
13+
static forRoot(): ModuleWithProviders {
14+
return {
15+
ngModule: PlotlyModule,
16+
providers: [PlotlyService]
17+
};
18+
}
1319
}

0 commit comments

Comments
 (0)