Reputation: 78254
This worked in angular2... 2.x
imports: [
....
ChartModule.forRoot(require('highcharts'))
]
In an angular2 4.0.1
Failed to compile.
/Users/angular2isstupid/Documents/frontend/ang4test/src/app/app.module.ts (44,25): Cannot find name 'require'.
How do I deal with these changes?
Upvotes: 1
Views: 707
Reputation: 167
Try adding
declare var require: any;
to your src/typings.d.ts file.
Upvotes: 4