why this sendAction does not call addEvent in controller?
I get in console: Uncaught TypeError: undefined is not a function
So obviously “this” is pointing somewhere else, how to call sendAction then?
Bellow is component code:
import Ember from ‘ember’;
export default Ember.Component.extend({
newEvent: “”, eventTitle: “”,
_initializeCalendar: (function() {
return $("#calendar").fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: Date.now(),
editable: true,
eventLimit: true, // allow "more" link when too many events
events: this.theEvents,
dayClick: function(date, jsEvent, view) {
this.sendAction("addEvent")
}
});
}).on(“didInsertElement”)
});