indra257
indra257

Reputation: 86

angular2-Highcharts not working in angular-cli project

I have created a new project using angular-cli I followed all the steps that are suggested at the page https://www.npmjs.com/package/angular2-highcharts

npm install angular2-highcharts --save import { ChartModule } from 'angular2-highcharts'; ChartModule.forRoot(require('highcharts')

When I run the app, it says cannot find name 'require' Do I need to follow any other steps.

Upvotes: 2

Views: 713

Answers (1)

Omar Bait
Omar Bait

Reputation: 11

Try to add this dclaration on your component : declare var require: any;

I had the same problem. I didn't have much time to resolve the problem. So i used ng2-highchart (an alternative for angular2-highcharts).

-you can follow instruction for installation by there

-You will find the github project for more informations.

-With an example on Angular-Cli .

Upvotes: 1

Related Questions