Last active
July 21, 2016 21:29
-
-
Save patrickberkeley/3901bf2bf11c65cff1b5 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 DS from 'ember-data'; | |
export default DS.FixtureAdapter.extend(); |
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', | |
isVisible: false, | |
actions: { | |
toggleInput() { | |
this.toggleProperty('isVisible'); | |
}, | |
submit() { | |
this.get('model').save(); | |
} | |
} | |
}); |
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({ | |
model() { | |
return this.store.createRecord('my-model'); | |
} | |
}); |
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'; | |
const { | |
attr | |
} = DS; | |
const MyModel = DS.Model.extend({ | |
someProperty: attr('string') | |
}); | |
MyModel.reopenClass({ | |
FIXTURES: [ | |
{ | |
id: 1, | |
someProperty: 'Dickinson' | |
}, | |
{ | |
id: 2, | |
someProperty: 'Twain' | |
} | |
] | |
}); | |
export default MyModel; |
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.5.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "1.13.13", | |
"ember-data": "1.13.15", | |
"ember-template-compiler": "1.13.13" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment