【问题标题】:How to add angular attribute directive to input in rails slim template?如何在rails slim模板中添加角度属性指令输入?
【发布时间】:2015-06-21 13:15:15
【问题描述】:

尝试将自定义角度属性指令附加到 rails slim 模板。但并不是所有的尝试都成功。

这里是代码

input#title.form-control placeholder="Product titile" type="text" ng-model='product.title' server-error

其中 'server-error' 是一个自定义指令。但是当浏览器渲染这个 html 时,这个指令会被截断并打印为纯文本。

你能给点建议吗? 谢谢

【问题讨论】:

    标签: angularjs html templates ruby-on-rails-4 slim-lang


    【解决方案1】:

    尝试使用括号语法

    input#title.form-control(type='text' ng-model='product.title' server-error)

    这也应该有效:

    input#title.form-control type='text' ng-model='product.title' server-error=''

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多