所以我這裏面計算的屬性我component.js
:contexts: Ember.computed.oneWay('myService.contexts'),
Ember.js:從服務使用在車把上的計算性能
,我能夠從另一個動作得到上述內容
openHelp(){
console.log(this.get('contexts'))
alert(this.get('contexts'))
}
}
但當我嘗試使用Handlebars中的計算屬性({{contexts}}
)時,它只是空白。
如果我有一個數組foo: [ 'foo','bar']
和我{{FOO}}它車把輸出。但是,如果我使foo
的計算屬性獲得[ 'foo','bar']
,並且做了{{foo}}
,我什麼也得不到。