【问题标题】:Handle scope variables with handlebars使用把手处理范围变量
【发布时间】:2016-03-01 16:33:19
【问题描述】:

使用 handlebars-1.1.2 和旧的 emberjs 1.5.1。

我只需要在标签的“for”中放一个变量:

<label for='{{queue.id}}'>

相反

<label for="6">

我明白了

<label for="<script id=" metamorph-51-start'="" type="text/x-placeholder">6<script id="metamorph-51-end" type="text/x-placeholder"></script>'&gt;<script id="metamorph-52-start" type="text/x-placeholder"></script>Очередь через личный кабинет<script id="metamorph-52-end" type="text/x-placeholder"></script></label>

如果我只是在模板中使用 {{queue.id}} 就可以了。

如何在 html 属性中传递该值?

【问题讨论】:

    标签: html ember.js handlebars.js


    【解决方案1】:

    在这个版本的 emberjs 中我应该写

    <label {{bind-attr for=queue.id}}>
    

    【讨论】:

      猜你喜欢
      • 2014-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-23
      相关资源
      最近更新 更多