Last active
April 24, 2017 15:56
-
-
Save uhrohraggy/bf9741b3fb152a1f455ae48df51547b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'VisitDays' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from "ember-data/model"; | |
import attr from "ember-data/attr"; | |
import { belongsTo, hasMany } from "ember-data/relationships"; | |
export default Model.extend({ | |
firstName: attr("string"), | |
lastName: attr("string"), | |
visits: belongsTo("visit") | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from "ember-data/model"; | |
import attr from "ember-data/attr"; | |
import { belongsTo, hasMany } from "ember-data/relationships"; | |
export default Model.extend({ | |
name: attr("string"), | |
users: hasMany("user"), | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
beforeModel() { | |
var user1 = this.store.createRecord("user", { | |
id: 1, | |
firstName: "First", | |
lastName: "User", | |
}); | |
var user2 = this.store.createRecord("user", { | |
id: 2, | |
firstName: "Second", | |
lastName: "User", | |
}); | |
var user3 = this.store.createRecord("user", { | |
id: 3, | |
firstName: "Third", | |
lastName: "User", | |
}); | |
var user4 = this.store.createRecord("user", { | |
id: 4, | |
firstName: "Fourth", | |
lastName: "User", | |
}); | |
var user5 = this.store.createRecord("user", { | |
id: 5, | |
firstName: "Fifth", | |
lastName: "User", | |
}); | |
var visit1 = this.store.createRecord("visit", { | |
id: 1, | |
name: "Morning Visit", | |
users: [user1, user2, user3] | |
}); | |
var visit2 = this.store.createRecord("visit", { | |
id: 2, | |
name: "Afternoon Visit", | |
users: [user4, user5] | |
}); | |
var visit3 = this.store.createRecord("visit", { | |
id: 3, | |
name: "Afternoon Visit No One Attending", | |
users: [] | |
}); | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.10.5", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.12.0", | |
"ember-data": "2.12.1", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment