Open gabrielp16 opened 7 years ago
@gabrielp16 I assume you're talking about the scheduler
attribute.
Is it a real nested model (an instance of BB.Model with attributes date and type) or just a plain object (POJO)?
Is a a plain object (POJO)... that change the point of view?
In this case you can use converters, like that:
binder.bind(model, el, {
scheduler: [
{
selector: '.date',
converter: (dir, value) => {
if (dir === ModelBinder.Constants.ModelToView) return value.date;
else return Object.assign({}, model.get('scheduler'), {date: value});
}
},
// ... and a similar binding for "type"
],
});
Hi,
I have a problem with a nested model: { name:'Gabo', scheduler:{ date: 1987198712, type: 'daily' } } the modelBind doesn't recognize the properties in scheduler, how can I do for make a bind in date and type?
Thank you for your attention