Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb7c4392

Browse files
committed
Adding plotly-via-window.module
1 parent0c5e59b commitb7c4392

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

‎projects/demo_app/src/app/app.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { PlotlyViaCDNModule } from 'projects/plotly/src/lib/plotly-via-cdn.modul
77

88

99
import{AppComponent}from'./app.component';
10+
import{PlotlyViaWindowModule}from'projects/plotly/src/lib/plotly-via-window.module';
1011

1112

1213
@NgModule({
@@ -16,7 +17,8 @@ import { AppComponent } from './app.component';
1617
imports:[
1718
BrowserModule,
1819
// PlotlyModule.forRoot(PlotlyJS),
19-
PlotlyViaCDNModule.forRoot({version:'3.0.1'}),
20+
// PlotlyViaCDNModule.forRoot({version: '3.0.1'}),
21+
PlotlyViaWindowModule,
2022
],
2123
providers:[],
2224
bootstrap:[AppComponent]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import{NgModule}from'@angular/core';
2+
import{PlotlyService}from'./plotly.service';
3+
import{PlotlyComponent}from'./plotly.component';
4+
5+
6+
@NgModule({
7+
imports:[PlotlyComponent],
8+
providers:[PlotlyService],
9+
exports:[PlotlyComponent],
10+
})
11+
exportclassPlotlyViaWindowModule{
12+
constructor(){
13+
constplotly=(windowasany).Plotly;
14+
15+
if(typeofplotly==='undefined'){
16+
thrownewError(`Plotly object not found on window.`);
17+
}
18+
19+
PlotlyService.setPlotly(plotly);
20+
}
21+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp