我有这个主干模型:
graphModel
attributes
country
indicator
year
对应的视图:
graphView
render()
this.model.get(...)
该应用程序还有一个加载 csv 数据的通用数据源:
dataSource
indicators
indicatorA
country
year
indicatorB
countries
years
每次更改模型属性时,我想在触发更改事件之前检查是否加载了该属性组合的数据。
我的问题是:将数据源与 Backbone 模型和视图解耦以便我可以轻松尝试注入的模拟数据的好方法是什么?