8000 Converting the PlotlyComponent to standalone: true · plotly/angular-plotly.js@3d7cfe1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d7cfe1

Browse files
committed
Converting the PlotlyComponent to standalone: true
1 parent e5211dc commit 3d7cfe1

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

projects/plotly/src/lib/plotly-shared.module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { PlotlyComponent } from './plotly.component';
66

77

88
@NgModule({
9-
declarations: [PlotlyComponent],
10-
imports: [CommonModule],
9+
imports: [CommonModule, PlotlyComponent],
1110
providers: [PlotlyService],
1211
exports: [PlotlyComponent],
1312
})

projects/plotly/src/lib/plotly.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('PlotlyComponent', () => {
1919
windowSpy = jasmine.createSpyObj('Window', ['addEventListener', 'removeEventListener']);
2020

2121
TestBed.configureTestingModule({
22-
declarations: [PlotlyComponent],
22+
imports: [PlotlyComponent],
2323
providers: [
2424
PlotlyService,
2525
],

projects/plotly/src/lib/plotly.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,20 @@ import {
1818
output,
1919
OutputEmitterRef,
2020
} from '@angular/core';
21+
import { CommonModule } from '@angular/common';
2122

2223
import { PlotlyService } from './plotly.service';
2324
import { Plotly } from './plotly.interface';
2425

2526
// @dynamic
2627
@Component({
2728
selector: 'plotly-plot',
29+
standalone: true,
30+
imports: [CommonModule],
2831
template: `<div #plot [attr.id]="divId()" [ngClass]="getClassName()" [ngStyle]="style()">
2932
<ng-content></ng-content>
3033
</div>`,
3134
providers: [PlotlyService],
32-
standalone: false
3335
})
3436
export class PlotlyComponent implements OnInit, OnChanges, OnDestroy, DoCheck {
3537
protected defaultClassName = 'js-plotly-plot';

0 commit comments

Comments
 (0)
0