Ember.js查看不显示Ember.TextField {{view Ember.TextArea valueBinding =" Name"命名= QUOT;姓名"}} [英] Ember.js View not displaying Ember.TextField {{view Ember.TextArea valueBinding="Name" name="Name"}}

查看:141
本文介绍了Ember.js查看不显示Ember.TextField {{view Ember.TextArea valueBinding =" Name"命名= QUOT;姓名"}}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示此输入,因此我可以编辑类别的名称,但视图未显示。

I want to show this input so I may edit a category's 'Name', but the view is not displaying.

结果只是列表中出现的每个类别的名称。每个类别都应该有自己的输入,其值设置为该类别的名称。

The result is only the Names for each Category appearing on the list. Each category should have it's own input with a value set to the 'Name' for that Category.

我没有收到任何错误,所以我做错了什么? / p>

I am not receiving any errors, so what am I doing incorrectly?

  {{#each}}
   <tr>
     <td>
      {{view Ember.TextField valueBinding="Name" name="Name"}}
      <label class="category-text">
        {{#linkTo 'category' this}}
          {{Name}}
        {{/linkTo}}
      </label>
     </td>
  </tr>
{{/each}}

编辑:

我一直在玩实现不同的输入法,但没有一个出现在类别列表中! Waaah?

I've been playing around with implementing different input methods and none of them are showing up on the list of Categories! 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');
},


推荐答案

不要以为使用建议直接推荐 Ember.TextField ,您应该使用 {{input value = name}} 此处有关输入助手的更多文档。

Don't think using Ember.TextField directly is recommended anymore, you should use {{input value=name}} instead. More documentation on the input helper here.

这篇关于Ember.js查看不显示Ember.TextField {{view Ember.TextArea valueBinding =&quot; Name&quot;命名= QUOT;姓名&QUOT;}}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆