angular checklist-model throws组元素没有父元素

时间:2016-11-14 14:21:55

标签: javascript ruby-on-rails angularjs

我试图使用checklist-model角度模块,但它引发了这个错误,我无法弄清楚:

No parent form group element found for input element <input type="checkbox" 
  value="correlation" name="question[insights][enable][]"
  id="question_insights_enable_correlation" ng-model="checked"
  class="ng-scope ng-pristine ng-untouched ng-valid" bs-validation="">

元素由rails定义:

<%= insights_form.check_box("enable", {:multiple => true,
    'checklist-model' => "model.enabled_insights"}, :correlation, nil) %>

结果是:

<input checklist-model="model.enabled_insights" type="checkbox" value="correlation"
    name="insights[enable][]" id="insights_enable_correlation" />

如果我删除了checklist-model属性,则错误消失。我已经用Google搜索了错误,但无法找到任何有其他人参考的错误。

1 个答案:

答案 0 :(得分:0)

这已成为代码的另一个分支中添加的bootstrap-angular-validation库的问题。

<div class="form-group">中的复选框元素包装好。