ember.js - How do you assign a static data- attribute to an ember view? -


i need assign static data- attribute ember.view, how set in view object instead of in {{view }} tag.

app.messagesformview = ember.view.extend({   tagname: 'div',   classnames: ['modal', 'fade'],   didinsertelement: function() {     this.$().modal('show')   },   willdestroyelement: function() {     this.$().modal('hide')   }, }) 

unfortunately, don't have enough reputation comment on ola's answer, believe better way not use string (text in quotation marks) denote data attribute property name. instead, write property name in camelcase , ember automatically bind hyphenated attributebinding. example:

app.messagesformview = ember.view.extend({   tagname: 'div',   attributebindings: ['data-backdrop'],    databackdrop: 'static', // binds data-backdrop. awesome! }); 

i hope makes sense!


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -