How to add angular attribute directive to input in rails slim template?

865 views Asked by At

Trying to attach custom angular attribute directive to rails slim template. But all attempts are not successful.

Here is the code

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

where 'server-error' is a custom directive. But when browser renders this html this directive is cutted off and printed as a plain text.

Can you advice something? Thanks

1

There are 1 answers

0
Tomek Sułkowski On BEST ANSWER

Try using parenthesis syntax:

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

This should also work:

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