0
votes

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.

1

1 Answers

1
votes

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