Skip to content

Commit 0322ea5

Browse files
alystandrefarzat
authored andcommitted
use [ngClass] to set "class" attribute of div
*ngClass* better integrates with the rest of Angular and, unlike "className", doesn't overwrite the classes set by Angular core or other directives.
1 parent 5f67166 commit 0322ea5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { Plotly } from './plotly.interface';
2525
// @dynamic
2626
@Component({
2727
selector: 'plotly-plot',
28-
template: `<div #plot [attr.id]="divId" [className]="getClassName()" [ngStyle]="style"></div>`,
28+
template: `<div #plot [attr.id]="divId" [ngClass]="getClassName()" [ngStyle]="style"></div>`,
2929
providers: [PlotlyService],
3030
})
3131
export class PlotlyComponent implements OnInit, OnChanges, OnDestroy, DoCheck {

0 commit comments

Comments
 (0)