Created
April 19, 2018 19:15
-
-
Save ryandjones14/c54fb57132b4249d9600c7b4f71c58bc to your computer and use it in GitHub Desktop.
ember-til
This file contains hidden or 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', | |
// list: Ember.computed('model', function() { | |
// return this.get('model'); | |
// }, | |
placeholder: 'wut u lern 2day?', | |
buttonText: 'add', | |
newContent: '', | |
actions: { | |
addNewItem: function(content) { | |
let model = this.get('model'); | |
let newContent = this.get('newContent'); | |
const newItem = this.store.createRecord('item', { content: newContent }); | |
console.log('testtesttest', this.store); | |
newItem.save(); | |
// model.push | |
} | |
} | |
}); |
This file contains hidden or 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({ | |
content: DS.attr('string'), | |
}); |
This file contains hidden or 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 [{content: 'kids in Scotland are called Young Scots'},{content: 'if you get fouled you get fouled'}]; | |
} | |
}); |
This file contains hidden or 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.13.1", | |
"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.16.2", | |
"ember-template-compiler": "2.16.2", | |
"ember-testing": "2.16.2" | |
"ember-cli-mirage": "0.2.3", | |
}, | |
"addons": { | |
"ember-data": "2.16.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment