gpt4 book ai didi

backbone.js - 在collection.parse期间没有一致地调用backbone model.parse

转载 作者:行者123 更新时间:2023-12-02 21:40:50 25 4
gpt4 key购买 nike

在我的大多数情况下,model.parse是在collection.parse期间调用的。在某些情况下,不会调用 model.parse。

我在所有情况下都需要它。是否可以将其放置在全局某个位置,如类似的选项:Backbone.emulateHTTP = true;

此外,文档还提供了有关 model.parse 的看似冲突的信息

model.parse(response, options)

parse is called whenever a model's data is returned by the server, in fetch, and save.

与可能/也许

model.initialize ... If {parse: true} is passed as an option, the attributes will first be converted by parse before being set on the model.

最佳答案

好的。我解决了。看来官方文档很困惑。这里是关于何时何地使用 parse: true 选项的更简洁的描述。

http://adzdavies.blogspot.ca/2012/08/backbone-parsing.html

关于backbone.js - 在collection.parse期间没有一致地调用backbone model.parse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20479037/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com