Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 43e506f

Browse files
authored
Merge pull request #29 from fischor/master
Exports PlotlyService within static forRoot() method.
2 parents 12f16c5 + b855411 commit 43e506f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/app/plotly/plotly.module.ts

Lines changed: 11 additions & 5 deletions
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)