我想顯示這個輸入,所以我可以編輯一個類別的'名稱',但視圖是不顯示。Ember.js查看不顯示Ember.TextField {{view Ember.TextArea valueBinding =「Name」name =「Name」}}
結果只是出現在列表中的每個類別的名稱。每個類別都應該有自己的輸入,其值設置爲該類別的「名稱」。
我沒有收到任何錯誤,所以我做錯了什麼?
{{#each}}
<tr>
<td>
{{view Ember.TextField valueBinding="Name" name="Name"}}
<label class="category-text">
{{#linkTo 'category' this}}
{{Name}}
{{/linkTo}}
</label>
</td>
</tr>
{{/each}}
編輯:
我一直在執行不同的輸入法,沒有張師傅表示分類的列表最多打轉轉! Waaah?
這裏是我的嘗試:
<input type="text" Value="Name">
,
{{input type="text" valueBinding="Name" name="Name"}}
EDIT2:
VpcYeoman.CategoriesRoute = Ember.Route.extend({
model: function() {
VpcYeoman.Category.FIXTURES=[];
$.ajax({
url: '/categories',
dataType: 'json',
type:"get",
async: false,
success : function(data) {
VpcYeoman.Category.FIXTURES=data;
}
});
return this.store.find('category');
}
});
和
model: function() {
return this.store.find('category');
},
您的「{{/每個}}」應該移動一行,以便它包含「」。我不確定這是不是你的問題的原因,但它肯定無濟於事。 – gravityplanx
好的。我的代碼中有這樣的錯誤,但是我錯誤地使用了它。我在這個問題上做了更新。 –