I defined a chart properties in the controller . in the event property the controller property is undefined
How can I get access to the controller in click event in chart ?
I defined a chart properties in the controller . in the event property the controller property is undefined
How can I get access to the controller in click event in chart ?
make chartData
a computed property, that way you have access to the controller’s this
as you build your object.
import Ember from 'ember';
const { computed } = Ember;
export default Ember.Controller.extend({
chartData: computed(function() {
return [{
point: {
events: {
click: () => {
this.onClick();
}
}
}
}];
}),
onClick() {
console.log('onClick() called');
}
});