Backbone change model of View

Riebel提出了一个问题:Backbone change model of View,或许与您遇到的问题类似。

回答者zsitro给出了该问题的处理方式:

One of your solution is close to be okay :D

Here is what you want:

this.view.community.model.set(communities.get(id).toJSON());

And this will trigger model.on("change") as well.

希望本文对你有帮助,欢迎支持JavaScript中文网