Closed felipehw closed 10 years ago
One solution could be to implement the init
method and merge the two objects yourself:
// ...
concatenatedProperties: ['sockets'],
init: function init() {
var sockets = this.get('sockets'),
merged = $.extend(sockets[0], sockets[1]);
this.set('sockets', merged);
this._super();
}
// ...
Many thanks @Wildhoney ! Works perfectly. One improvement is allow the merge with more than two objects dynamically:
concatenatedProperties: ['sockets'],
init: function() {
var that = this,
sockets = that.get('sockets'),
merged = Ember.$.extend.apply( Ember.$, sockets );
that.set('sockets', merged);
that._super();
},
Thanks. Nicely done :+1:
The
actions
hash in controllers inherit action handlers from parent classes ... how can i mimic this behavior withsockets
hash in controllers?I explained this problem in: https://stackoverflow.com/questions/26661229/how-do-a-hash-property-in-a-parent-class-controller-be-mixed-with-a-property-wit