Skip to content

Instantly share code, notes, and snippets.

@egrueter-dev
Created June 15, 2015 19:32
Show Gist options
  • Save egrueter-dev/070a375c5a468f241ec3 to your computer and use it in GitHub Desktop.
Save egrueter-dev/070a375c5a468f241ec3 to your computer and use it in GitHub Desktop.
Ember_router
import Ember from 'ember';
export default Ember.Route.extend({
model: function (params) {
return Ember.RSVP.hash({
school: this.store.find('school', params.school_id),
// data: Ember.$.getJSON('api/surveygizmodata', { school_id: params.school_id }
// need to : use a call like this one to retrieve your data from the server.
}).then(function (hash) {
// set your data as an attribute of the model here:
// hash.school.set('surveyDashboardData', hash.data);
return hash.school;
});
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment