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
Post a Comment