0

是否有任何“实用程序带”库(思考 underscore.js)可以映射到具有不同模式的其他类?

只是一个例子:-

var results = {
  "d": {
    "results":
        {
        "ContentTypeID": "0x0100EF81D4A521AFFB4A810FD140B2C3A516",
        "Title": "Acme",
        "ID": 1234
        }       
    }
}

映射到

var customer = {
    "Customer": "Acme",
    "ID": 1234
}
  • 身份证=身份证
  • 标题 = 客户
  • ContentTypeID 未表示
4

1 回答 1

1

ExtJS has a pretty nice concept of data stores which you can do mapping like you described.

http://docs.sencha.com/ext-js/4-2/#!/api/Ext.data.JsonStore

Ember also has data models / stores.

于 2013-03-19T15:22:58.930 回答