forked from preboot/angularjs-webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
54 lines (48 loc) · 1.14 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import angular from 'angular';
import 'chart.js';
import 'angular-chart.js';
import '../style/app.css';
let app = () => {
return {
template: require('./app.html'),
controller: 'AppCtrl',
controllerAs: 'app'
}
};
class AppCtrl {
constructor() {
this.labels = ["January", "February", "March", "April", "May", "June", "July"];
this.series = ['Series A', 'Series B'];
this.data = [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
];
this.onClick = function(points, evt) {
console.log(points, evt);
};
this.datasetOverride = [{yAxisID: 'y-axis-1'}, {yAxisID: 'y-axis-2'}];
this.options = {
scales: {
yAxes: [
{
id: 'y-axis-1',
type: 'linear',
display: true,
position: 'left'
},
{
id: 'y-axis-2',
type: 'linear',
display: true,
position: 'right'
}
]
}
};
}
}
const MODULE_NAME = 'app';
angular.module(MODULE_NAME, ['chart.js'])
.directive('app', app)
.controller('AppCtrl', AppCtrl);
export default MODULE_NAME;