- Update
constructor
to receive arguments directly- Implemented in this PR, just needs review and merge
- Probably could be simplified in Ember 3, we can remove multi-object
create
- Update concatenated and merged properties in RFC
- Concatenated and merged properties will not be able to work the way they used to.
- No way to know the value of a field before an instance is created
- Parent class constructor finishes before child constructor, so no way to get value in
makeCtor
base constructor
- Fix native getters/setters (make mandatory setter aware of them)
applyMixin
,watchKey
, anddefineProperty
erase native getters and setters
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 123', | |
foo() { | |
alert(this.appName); | |
} | |
}); |
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', | |
_foo: 0, | |
bar: 0, | |
// foo: Ember.computed({ | |
// get() { |
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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
init() { | |
Ember.Object.extend({ | |
foo: Ember.computed(function() {}).readOnly() | |
}).create({ | |
foo: 'bar' |
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'; | |
import { or, readOnly } from '@ember/object/computed'; | |
import { observer } from '@ember/object'; | |
export default Component.extend({ | |
unwrappedApi: or('api.api', 'api'), | |
foo: readOnly('unwrappedApi.foo'), | |
bar: readOnly('foo.bar'), |
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({ | |
init() { | |
this._super(...arguments); | |
this.foo = () => { this.set('bar', 'baz'); } | |
} | |
}); |
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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
items: [{ name: 'foo' }, { name: 'bar' }], | |
sorter: Ember.computed.sort('items', ['name:asc']) | |
}); |
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'; | |
let FooComponent = Ember.Component.extend({ | |
baz: Ember.computed('foo', function() { | |
return this.get('foo'); | |
}), | |
fooObserver: Ember.observer('foo', function() { | |
this.set('qux', 'quux'); | |
}), |