Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Ember JS中选择动态创建的复选框_Javascript_Ember.js_Checkbox_Ember Cli - Fatal编程技术网

Javascript 在Ember JS中选择动态创建的复选框

Javascript 在Ember JS中选择动态创建的复选框,javascript,ember.js,checkbox,ember-cli,Javascript,Ember.js,Checkbox,Ember Cli,嗨,我正在从服务器端模型中提取数据,并通过复选框填充它们。 如何获取复选框的用户选择? 我知道this.get('isChecked')可以为我获取复选框的值,但是在我的用户案例中,由于将动态填充数量可变的复选框,我该如何做呢 注意:我没有使用Ember数据并通过从我的router类调用Ember.$.JSON()来填充模型 我试着遵循这里给出的例子 这里呢 但他们似乎都没有为我工作 品牌模型有一个选中的布尔属性,默认情况下该属性选择为false {{#each brand in model

嗨,我正在从服务器端模型中提取数据,并通过复选框填充它们。 如何获取复选框的用户选择? 我知道
this.get('isChecked')
可以为我获取复选框的值,但是在我的用户案例中,由于将动态填充数量可变的复选框,我该如何做呢

注意:我没有使用Ember数据并通过从我的router类调用Ember.$.JSON()来填充模型

我试着遵循这里给出的例子 这里呢 但他们似乎都没有为我工作

品牌模型有一个选中的布尔属性,默认情况下该属性选择为false

  {{#each brand in model}}

      <div class="col-lg-2 col-xs-4">
       <div class="brand-select-image-container">
           {{input type="checkbox" name=brand.brand_name checked=brand.checked class="brand-select-checkbox" }}

          <img src="http://localhost:3000{{brand.img_location}}" class="brand-select-image"/>

       </div>
          <p class="brand-select-name">{{brand.brand_name}}</p>
      </div>

  {{/each}}
{{{车型中的每个品牌}
{{input type=“checkbox”name=brand.brand\u name checked=brand.checked class=“brand select checkbox”}

{{brand.brand\u name}

{{/每个}}
好的,我为其他任何一个在如何使用余烬复选框方面遇到困难的人修复了它

  this.get('model').forEach(function(item){
    console.log(item.checked);
  });