Is there a way to extend the data
option when using IronRouter and the RouteController
, It seems like it gets overridden when I inherit from a super co
I use something similar to this in a production app:
Router.route('/test/:testparam', {
name: 'test',
controller: 'ChildController'
});
ParentController = RouteController.extend({
data: function() {
console.log('child params: ', this.params);
return {
foo: 'bar'
};
}
});
ChildController = ParentController.extend({
data: function() {
var data = ChildController.__super__.data.call(this);
console.log(data);
return data;
}
});
Using __super__
seems to do the trick!
You can than use _.extend to extend the data (http://underscorejs.org/#extend)