Created
July 29, 2015 07:02
-
-
Save davidgovea/94ddb66ba95516bc09a8 to your computer and use it in GitHub Desktop.
New Twiddle
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:'Ember Twiddle', | |
doFakeStuff: function() { | |
var server = sinon.fakeServer.create(); | |
server.respondWith("GET", "/myModels", | |
[200, { "Content-Type": "application/json" }, | |
JSON.stringify(this.get('fakeData'))]); | |
console.log('lool') | |
this.store.findAll('myModel') | |
.then((a) => { | |
console.log(a, "WOWOWOW") | |
}); | |
}.on('init'), | |
fakeData: { | |
"id": 10, | |
"submitted_by": { | |
"id": 10, | |
"username": "arskinner" | |
}, | |
"question": "What's your favorite song on Graduation?" | |
}, | |
}); |
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 DS from 'ember-data'; | |
export default DS.Model.extend({ | |
username: DS.attr('string') | |
}); |
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.4.0", | |
"dependencies": { | |
"sinon": "http://sinonjs.org/releases/sinon-server-1.15.4.js", | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.5/ember.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/1.13.5/ember-data.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment