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"}} 

working example.

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"}} 

working example.

hope helps.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -