Here is the content of my app module file. All components and imports are in their respective places as specified in the documentation:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import * as PlotlyJS from 'plotly.js-dist';
import { PlotlyModule } from 'angular-plotly.js';
PlotlyModule.plotlyjs = PlotlyJS;
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, PlotlyModule],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Below is the error message I encountered in the console:
main.ts:12 Error: Invalid PlotlyJS object. Please check https://github.com/plotly/angular-plotly.js#quick-start to see how to add PlotlyJS to your project.
at new PlotlyModule (angular-plotly.js.js:520)
at Object.PlotlyModule_Factory [as factory] (angular-plotly.js.js:529)
at R3Injector.hydrate (core.js:11416)
at R3Injector.get (core.js:11236)
at core.js:11273
at Set.forEach (<anonymous>)
at R3Injector._resolveInjectorDefTypes (core.js:11273)
at new NgModuleRef$1 (core.js:25336)
at NgModuleFactory$1.create (core.js:25390)
at core.js:29276