var value = attr.inlineEdit;
var field = value.substring(11);
//Here I have first_name in field variable
user.hit({field : scope.model}, auth.getCurrentUser().user_id).success(function () {
console.log("Saved");
});
In the field key, I want that should be have first_name when I have first_name in field variable but I'm getting only field as a key.
It's weird but I need to do something on it.
我认为{[field]:scope.model}是您真正想要的。
为什么不使用first_name
作为键来创建嵌套对象:
{field : { first_name : scope.model }}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.