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', | |
actions: { | |
destroyRecord(model) { | |
model.get('children').then( (children) => { | |
//children.invoke('deleteRecord'); | |
//children.forEach( (child) => { |
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({ | |
all: Ember.A([{id:3,text:'abb'},{id:1,text:'a'},{id:2,text:'ab'}]), | |
sortedQueue: Ember.computed.sort('all', 'sortProp'), | |
sortProp: ['id:desc'], | |
wrongSortedQueue: Ember.computed.sort('all', 'id:desc'), | |
}); |
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
"_args": [ | |
[ | |
"ember-data@^2.3.1", | |
"/Users/sma01/work/frontend" | |
] | |
], | |
"_from": "ember-data@>=2.3.1 <3.0.0", | |
"_id": "[email protected]", | |
"_inCache": true, |
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.Component.extend({ | |
store: Ember.inject.service(), | |
init() { | |
this._super(...arguments); | |
this.get('store').push({data: [{ | |
id: 42, | |
type: 'plic', |
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'; | |
var FilePath = Em.Object.extend({ | |
default: null, | |
fileName: Em.computed.oneWay('default'), | |
path: Em.computed('fileName', function() { | |
return '/path/' + this.get('fileName'); | |
}) | |
}); |
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'; | |
const { computed } = Ember; | |
export default Ember.Controller.extend({ | |
commentArray: computed('model.comments.[]', function() { | |
return this.get('model.comments').toArray(); | |
}), | |
favourites: computed.filterBy('model.comments', 'isFavourite'), | |
favouritesHack: computed.filterBy('commentArray', 'isFavourite'), | |
}); |
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', | |
owner: Ember.computed(function() { | |
return this.store.createRecord('owner'); | |
}), | |
init() { |
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'; | |
var array = [{id: 42, name: 'blah'}, | |
{id: 43, name: 'oh'}, | |
{id: 44, name: 'ah'}]; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
someProp: true, |
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'; | |
var things = [{id: 42, name: 'blah'}, | |
{id: 43, name: 'oh'}, | |
{id: 44, name: 'ah'}]; | |
var things= [42,43, 44] | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', |