samedi 20 juin 2015

How to append innerHTML of a button on Ember.view

I have created a view for button.

App.NumberButtonView = Ember.View.extend({
tagName: 'button',
classNames: ['ButtonClass']
});

My button model is

App.NumberBtns = DS.Model.extend({
value: DS.attr('string'),
width: DS.attr('string'),
height: DS.attr('string'),
className: DS.attr('string'),
type:DS.attr('string')

})

App.NumberBtns.FIXTURES = [  {
id: '108',
value: '8',
style: {
    width: '50px',
    height: '50px'
},
className: 'NumberBtnClass',
type: 'number',
}, {
id: '109',
value: '9',
style: {
    width: '50px',
    height: '50px'
},
className: 'NumberBtnClass',
type: 'number',
}, {
id: '110',
value: '0',
style: {
    width: '50px',
    height: '50px'
},
className: 'NumberBtnClass',
type: 'number',

} ]

How can i pass the value of the button to the view from the controller.

We can do it by adding tags and appending the innerHTML. But how to append the innerHTML in the buttonView from model through controller




Aucun commentaire:

Enregistrer un commentaire