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 Component from '@ember/component'; | |
export default Component.extend({ | |
}); |
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'; | |
import { next } from '@ember/runloop'; | |
export default Ember.Component.extend({ | |
didInsertElement() { | |
this.list.items.pushObject(this); | |
} | |
}); |
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' | |
}); |
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; | |
let aCount = 0; | |
let bCount = 0; | |
let stableComputedKey = 0; | |
function stableComputed(...dependentKeys) { | |
let func = dependentKeys.pop(); |
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
/* | |
notifying the store that a record has been remotely deleted and should be fully removed. | |
*/ | |
function pushDeletion(store, type, id) { | |
let record = store.peekRecord(type, id); | |
if (record !== null) { | |
let relationships = {}; | |
let hasRelationships = false; | |
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({ | |
checked: Ember.computed('model.id', 'itemsToAdd.[]', function () { | |
const itemsToAdd = this.get('itemsToAdd'); | |
return !!itemsToAdd.findBy('id', this.get('model.id')); | |
}), | |
}); |
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({ | |
checked: Ember.computed('model.id', 'itemsToAdd.[]', function () { | |
const itemsToAdd = this.get('itemsToAdd'); | |
return !!itemsToAdd.findBy('id', this.get('model.id')); | |
}), | |
}); |
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'; | |
import deeplySet from '../utils/deeply-set'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
hierarchy: {}, | |
init() { | |
this._super(...arguments); | |
deeplySet(this.get('hierarchy'), 'company.region.department.employee.name', 'Jim Bob'); |
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({ | |
inputValue: null, | |
test: function() { | |
this.send('changeName', 'Name We Never See'); | |
}.observes('totalUsers'), | |
actions: { |
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: 'Notify Property Change Doesn\'t Force a Rerender', | |
value: null, | |
actions: { | |
set(value) { | |
this.set('value', value); | |
}, | |
validate() { |
NewerOlder