我有一个由我创建的contacts
数组组成的模型,但是,model.save
我不希望这个数组成为保存的一部分。任何人都可以推荐这是如何实现的,只是创建一个关键/值对象我想要POST
并将其传递给保存?
模型
{
"id": 1,
"name": "Joe Bloggs",
"position": "Manager",
"department": "Finance",
"manages": [
{
"id": "FR-1",
"name": "Jane Doe"
},
{
"id": "FR-23",
"name": "Simon Wakes"
}
],
"contacts": [
{
"id": "C123",
"name": "Julian Norris",
"telephone": "0123456789"
}
]
}
也许我需要做类似的事情:
var newModelData = {
"name": "Joe Alexander Bloggs",
"department": "Human Resources"
}
this.model.save(newModelData);