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.Component.extend({ | |
disabled: false, | |
click() { | |
if (!this.get('disabled')) { | |
console.log('stop-ember-bubble.js: '.padStart(25), 'Ember `click` event stopped'); | |
return false; | |
} |
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.Component.extend({ | |
// Component-level event handler receives jQuery.Event | |
click(e) { | |
console.log('clickHookEvent', e); | |
}, | |
actions: { | |
// {{action 'actionHelper'}} does not receive event |
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({ | |
foo: { | |
bar: 'test' | |
}, | |
lastUpdatedFoo: Ember.computed('foo', 'foo.bar', function () { | |
return Date.now(); | |
}), |
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({ | |
init() { | |
const store = this.get('store'); | |
const posts = [ | |
store.createRecord('post', { title: 'foo' }), | |
store.createRecord('post', { title: 'bar' }) | |
]; |
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'; | |
import Changeset from 'ember-changeset'; | |
export default Ember.Controller.extend({ | |
pojo: { | |
foo: 123, | |
bar: 456, | |
baz: Ember.Object.create() | |
}, |
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.Component.extend({ | |
// Count here demonstrates that this component provides data | |
count: 0, | |
dataToBeYielded: Ember.computed('count', function() { | |
return `Hello from bar! Count is ${this.get('count')}.`; | |
}), | |
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'; | |
import Foo from './foo-comp'; | |
import decorate from './decorate-hoc'; | |
export default decorate(Foo); |
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({ | |
proxy: Ember.computed(() => Ember.ArrayProxy.create({ content: [1, 2, 3] })), | |
concatProxy: Ember.computed('proxy', function () { | |
// Uncomment this and it breaks | |
// return this.get('proxy').concat([4, 5, ,6]); | |
return this.get('proxy'); |
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({ | |
// Change this to view the effect | |
isDisabled: false | |
}); |
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({ | |
unknownProperty(key) { | |
if (key === 'foo') { | |
return 'i am foo'; | |
} | |
return undefined; | |
} |
NewerOlder