derby-vm
Derby plugin for making a better distinction between vm (component's scoped model) and model (model.root).
vm refers to ViewModel, e.g. the model pertaining to a specific (component's) view/template. This is oddly named in Derby to model, which makes it difficult to separate the two. Thus, the need for this plugin.
How to use
Add the plugin:
derby;
In any init method of any component, you get two arguments instead of one:
MyComponentprototype { // vm === old model - i.e. the component's scoped model // model === old model.root - i.e. the root of all model data};MyComponentprototypecomponents =
Added to every component is two additional variables, vm and root:
MyComponentprototype { // New style === Old style // this.vm === this.model // this.root === this.vm.root};