私はemberJSで本当に新しいです、私は多くの 'これを参照してください。公式ガイドで emberオブジェクトモデルで私は 'this'を知っています。など、次のように、オブジェクト自体を表す:これはemberJSフレームワークで実際に表現されているものですか?
var obj = Ember.Object.extend({
baz: {
foo: 'BLAMMO',
bar: 'BLAZORZ'
},
something: Ember.computed('baz.{foo,bar}', function() {
return this.get('baz.foo') + ' ' + this.get('baz.bar');
})
});
これは、次のようなモデルとしてOBJ自体が、他の場合には、意味:ある
export default Ember.Route.extend({
model() {
this.store.push({
data: [{
id: 1,
type: 'album',
attributes: {
title: 'Fewer Moving Parts',
artist: 'David Bazan',
songCount: 10
},
relationships: {}
}, {
id: 2,
type: 'album',
attributes: {
title: 'Calgary b/w I Can\'t Make You Love Me/Nick Of Time',
artist: 'Bon Iver',
songCount: 2
},
relationships: {}
}]
});
}
});
何これは本当に表しますか?
ような何かを行うことによって、あなたの「これ」を自分で調べていませんアクションとは 'actions'ハッシュを含むオブジェクトを指し、' actions'ハッシュ自体はデフォルトJSの動作で通常期待されるものではありません。 –
ありがとう、あなたの提案はとても親切です。 – foolishfox