In a ListItem, I would like to bind data like this:
<ListItem pic:image="{presenter.imageurl}" />where the dataCollection looks like this:
Alloy.Collections.presentations = new Backbone.Collection(); Alloy.Collections.presentations.reset([ { title:'How To Train Your Dragon', scheduledDate: '05/01/2014', presenter: { firstname: 'Hiccup', lastname: 'Horrendous', imageurl: '/presenter/hiccup.jpg' }, capacity: 100 }, { title:'Assembler For Dummies', scheduledDate: '05/08/2014', presenter: { firstname: 'Michael', lastname: 'Macro', imageurl: '/presenter/macro.jpg' }, capacity: 50 } ]);My workaround right now is to implement a dataTransform callback and hack this in:
function doTransform(model) { var transform = model.toJSON(); transform.presenter_imageurl = transform.presenter.imageurl; return transform; }With the ListItem that looks like this:
<ListItem pic:image="{presenter_imageurl}" />Are there better ways to achieve this? Appreciate the help.