Mapping deeply hierarchical objects to custom classes using knockout mapping plugin
问题 Using the knockout mapping plugin ( http://knockoutjs.com/documentation/plugins-mapping.html ) can you map a deeply hierachical object? If I have an object with multiple levels: var data = { name: 'Graham', children: [ { name: 'Son of Graham', children: [ { name: 'Son of Son of Graham', children: [ { ... and on and on.... } ] } ] } ] } How do I map it to my custom classes in javascript: var mapping = { !! your genius solution goes here !! !! need to create a myCustomPerson object for Graham