From b85541106c0bac30a3e8cfcdf8adfa0f921a302e Mon Sep 17 00:00:00 2001 From: fischor Date: Sat, 29 Dec 2018 21:13:59 +0100 Subject: [PATCH] Exports PlotlyService within static forRoot() method. --- src/app/plotly/plotly.module.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/plotly/plotly.module.ts b/src/app/plotly/plotly.module.ts index ef44fb5..ab0c871 100644 --- a/src/app/plotly/plotly.module.ts +++ b/src/app/plotly/plotly.module.ts @@ -1,13 +1,19 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; +import { NgModule, ModuleWithProviders } from "@angular/core"; +import { CommonModule } from "@angular/common"; -import { PlotComponent } from './plot/plot.component'; +import { PlotComponent } from "./plot/plot.component"; +import { PlotlyService } from "./plotly.service"; @NgModule({ imports: [CommonModule], declarations: [PlotComponent], - exports: [PlotComponent], + exports: [PlotComponent] }) export class PlotlyModule { - + static forRoot(): ModuleWithProviders { + return { + ngModule: PlotlyModule, + providers: [PlotlyService] + }; + } }