Ractive-adaptors-modella
Ractive adaptor plugin for modella.
Installation
Component:
component install staygrimm/ractive-adaptors-modella
npm:
npm install ractive-adaptors-modella
Example
var modellaAdaptor = modella = Ractive = User user User = ; user = name: 'River' email: 'river.grimm@gmail.com'; view = template: '<span>{{name}} - {{email}}</span>' data: user adapt: ;; username'River Grimm'; view; // <span>River Grimm - river.grimm@gmail.com</span>
API
Adaptor([constructors])
Unline other Ractive adaptors, we need to initialize this adaptor with an array of Modella constructors. This is required as there's no easy method to discover if a model has been created by Modella. Instead, we have to check against the constructors Modella returns.
Test
npm install && make test
License
GPL v2