Skip to content

Instantly share code, notes, and snippets.

@20v100
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 20v100/f538e7b12874657d8f20 to your computer and use it in GitHub Desktop.
Save 20v100/f538e7b12874657d8f20 to your computer and use it in GitHub Desktop.
EmberjsPromisesExample
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return this.modelFor('post').get('causes');
},
});
import DS from 'ember-data';
export default DS.Model.extend({
uid: DS.attr('string'),
displayName: DS.attr('string'),
firstName: DS.attr('string'),
lastName: DS.attr('string'),
name: DS.attr('string'),
profilePictureURL: DS.attr('string'),
gender: DS.attr('string'),
language: DS.attr('string'),
timezone: DS.attr('number'),
age: DS.attr('number'),
phone: DS.attr('string'),
email: DS.attr('string'),
church: DS.attr('string'),
civicNumber: DS.attr('string'),
street: DS.attr('string'),
city: DS.attr('string'),
condition: DS.attr('string'),
country: DS.attr('string'),
website: DS.attr('string'),
type: DS.attr('string'),
group: DS.attr('boolean'),
newsletter: DS.attr('boolean'),
lastView: DS.attr('string'),
provider: DS.attr('string'),
statistics: DS.hasMany('statistic', { inverse: 'post', async: true}),
conditions: DS.hasMany('condition', { inverse: 'post', async: true}),
causes: DS.hasMany('cause', { inverse: 'post', async: true}),
adminScales: DS.hasMany('adminScale', { inverse: 'post', async: true}),
orgBoards: DS.hasMany('orgBoard', { inverse: 'post', async: true}),
tags: DS.hasMany('tag', { inverse: 'post', async: true}),
appLogs: DS.hasMany('appLog', { inverse: 'post', async: true}),
});
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
var authData = this.get('session.auth');
return this.store.find('post', authData);
}
});
import Ember from 'ember';
import config from './config/environment';
var Router = Ember.Router.extend({
location: config.locationType
});
Router.map(function() {
this.resource('post', function() {
this.resource('causes');
});
this.resource('login');
});
export default Router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment