2015-06-21 35 views
2

嘗試將自定義角度屬性指令附加到rails slim模板。但所有嘗試都不成功。如何在rails slim模板中添加角度屬性指令以輸入內容?

下面是代碼

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

其中「服務器錯誤」是一個自定義指令。但是當瀏覽器渲染這個html時,這個指令被切斷並打印成純文本。

你能提供一些建議嗎? 感謝

回答

2

嘗試使用括號語法

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

這也應該工作:

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

+1

非常感謝。兩個變種都在起作用。 – user2176575