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({ | |
init() { | |
this._super(); | |
this.set('prop', 'foo'); | |
setTimeout(() => { | |
Ember.run(() => { | |
this.set('prop', 'bar'); | |
Ember.run.schedule('afterRender', () => { |
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({ | |
}); |
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({ | |
items: [1, 2, 3], | |
remove() { | |
this.items.removeAt(0); | |
}, | |
reset() { |
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 PromiseMonitor from '../promise-monitor'; | |
let promise = new Promise(resolve => setTimeout(() => resolve('Done'), 2500)); | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
promise: new PromiseMonitor(promise) | |
}); |
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 { task, timeout } from 'ember-concurrency'; | |
export default Ember.Controller.extend({ | |
pollModelWithCustomStuff: task(function*() { | |
let poller = backoffPoller(() => model.reload()); | |
while (get(model, 'isRunning')) { | |
// Do custom stuff before polling | |
yield poller.poll(); |
This file has been truncated, but you can view the full file.
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
(function() { | |
/*! | |
* @overview Ember - JavaScript Application Framework | |
* @copyright Copyright 2011-2017 Tilde Inc. and contributors | |
* Portions Copyright 2006-2011 Strobe Inc. | |
* Portions Copyright 2008-2011 Apple Inc. All rights reserved. | |
* @license Licensed under MIT license | |
* See https://raw.github.com/emberjs/ember.js/master/LICENSE | |
* @version 2.16.2 | |
*/ |
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 MyMixin = Ember.Mixin.create({}); | |
new MyMixin(); | |
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'; | |
export default Ember.Component.extend({ | |
classNames: 'my-component', | |
didReceiveAttrs() { | |
this._updateVariables(); | |
}, | |
didInsertElement() { |
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 Scope from 'twiddle/cf/scope'; | |
import buildModule from 'twiddle/cf/build-module'; | |
const { | |
Controller, | |
computed, | |
} = Ember; |
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({ | |
products: Array.from(Array(100), (_, i) => ({ id: i, name: `Product #${i}` })), | |
displayItems: Ember.computed.map('products', product => ({ product, checked: false })), | |
selectedItems: Ember.computed.filterBy('displayItems', 'checked'), | |
selectedItemNames: Ember.computed('selectedItems.[]', function() { | |
return this.get('selectedItems').mapBy('product.name').join(', '); | |
}), |