我在我的路線中定義了一個散列。我想訪問這個散列並在我的Ember視圖中輸出值。Ember - 在視圖中輸出散列,但沒有任何顯示
路線/服務signups.js
model: function(){
return Ember.RSVP.hash({
defaultServiceSignups: {
service_1: false,
service_2: false,
service_3: true
}
});
}
在我看來(服務signups.hbs),我想通過我的散列輸出值進行迭代:
{{#each model.defaultServiceSignups }}
{{@key}} Value = {{this}}
{{/each}}
爲什麼我在視圖中看不到任何東西?這是完全空白的。
編輯1:
我想看看,如果我能輸出什麼,如果哈希是空的,甚至還低於下面的代碼不輸出任何東西:
{{#each model.defaultServiceSignups }}
<li>Something is present</li>
{{else}}
<li>Sorry nothing is there</li>
{{/each}}
什麼版本的Ember? –
@DanielKmak v1.13.0 – Huy