Reputation: 835
I have ember controller like this:
App.TripEditController = Ember.Controller.extend({
init: function(){
return this.store.find('trip', 1);
}
});
how do I access the data from ember template. I can't use ember route because it is a modal and I am using fancy-box to popup that modal.
Upvotes: 0
Views: 509
Reputation: 2592
You can try something like:
App.TripEditController = Ember.Controller.extend({
trip: null,
init: function(){
var self = this;
self._super.apply(this, arguments);
return self.store.find('trip', 1).then(function(trip){
self.set('trip', trip);
});
}
});
You should then be able to use something like {{trip}}
in your template
Upvotes: 1