I have a problem with binding to jagged array in knockout-js. I searched a lot, but could not find anything. Let's make a simple example,
<div data-bind="foreach: items"> <div data-bind="style: { textAlign: align, backgroundColor: bgColor, fontFamily: fontFamily, fontSize: size, color: color }, text: title"></div> </div>
and here is my array
var items = [{ title: 'A', align: 'right', fontFamily: 'helvetica', color: '#777777', bgColor: '#ffffff' }, { title: 'A', align: 'right', size: 'large', fontFamily: 'helvetica' } { size: 'large', fontFamily: 'helvetica', color: '#777777' }]
Is it clear that some property (s) are missing? Therefore, I get a * undefined * error. How to cope with this situation.
source share