html data- attributes in ember.js handlebars -
i trying this:
{{input value=email type="text" data-type="email"}}
in order use parsley.js validate inputs. (i know email can use type="email") example.
but seeing data-type="email"
not showing in generated html.
is there way can add html data- attribute handlebars tag?
there different approaches can it:
approach 1
you can reopen ember.textfield
, define additional attributebindings
, like:
ember.textfield.reopen({ attributebindings: ['data-type'] });
now work:
{{input value=email type="text" data-type="email"}}
approach 2
define own custom input field extending ember's ember.textfield
app.mytextfield = ember.textfield.extend({ attributebindings: ['data-type'] });
and use this:
{{view app.mytextfield value=email type="text" data-type="email"}}
hope helps.
Comments
Post a Comment