I want to wrap the following code as a define method
require([
'highcharts',
'highcharts/modules/exporting',
'highcharts/modules/accessibility'
], function (Highcharts) {
// This function runs when the above files have been loaded.
// Create a test chart.
Highcharts.chart('container', {
series: [{
data: [1,2,3,4,5]
}]
});
});
I use durandal SPA . so i need to have a define method to cal it from other places .
The simplest solution is to replace require
with define
:
define([
'highcharts',
'highcharts/modules/exporting',
'highcharts/modules/accessibility'
], function (Highcharts) {
Highcharts.chart('container', {
series: [{
data: [1,2,3,4,5]
}]
});
});