如何将 angular 属性指令添加到 rails slim 模板中的输入?
How to add angular attribute directive to input in rails slim template?
正在尝试将自定义 angular 属性指令附加到 rails slim 模板。但是所有的尝试都没有成功。
这是代码
input#title.form-control placeholder="Product titile" type="text" ng-model='product.title' server-error
其中 'server-error' 是自定义指令。但是当浏览器呈现此 html 时,此指令被截断并打印为纯文本。
你能给些建议吗?
谢谢
尝试使用 括号语法:
input#title.form-control(type='text' ng-model='product.title' server-error)
这也应该有效:
input#title.form-control type='text' ng-model='product.title' server-error=''
正在尝试将自定义 angular 属性指令附加到 rails slim 模板。但是所有的尝试都没有成功。
这是代码
input#title.form-control placeholder="Product titile" type="text" ng-model='product.title' server-error
其中 'server-error' 是自定义指令。但是当浏览器呈现此 html 时,此指令被截断并打印为纯文本。
你能给些建议吗? 谢谢
尝试使用 括号语法:
input#title.form-control(type='text' ng-model='product.title' server-error)
这也应该有效:
input#title.form-control type='text' ng-model='product.title' server-error=''