Trying to access an model assigned by route's setupController from my component. But only thing my console.log()
logs is a empty object with 3 other ember related object in it, seems un resolved but Ember Inspector says all my Promises are fulfilled. And a {{#each event in events}}
i have in my main.hbs works just fine..
full-calendar.js:
import Ember from "ember";
export default Ember.Component.extend({
attributeBindings: ['id'],
id: 'calendar',
setEvents:function (){
console.log(this.get("theEvents"));
}.observes("theEvents"),
_initializeCalendar: function() {
var self = this;
$("#calendar").fullCalendar({
lang: 'de',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
weekends: false,
dayClick: function(date) {
self.sendAction("dayClick",date);
},
});
}.on('didInsertElement')
});
main.hbs:
{{full-calendar theEvents=events dayClick="dayClick"}}
main.js
import Ember from "ember";
export default Ember.Route.extend({
setupController:function(controller){
controller.set('events', this.store.find('event'));
}
});