-
Notifications
You must be signed in to change notification settings - Fork 0
Model
Malexion edited this page Jan 13, 2017
·
1 revision
Class that generates an object templating engine allowing you to create objects off of a base set of defaults.
var User = new __.lib.Model({
name: '',
pass: '',
age: 1,
log: function() {
console.log(this); // this context bound to instance created
}
});
User.create({ name: 'frank' }).log();
var users = User.all([ { name: 'sue', age: 20 }, { name: 'joe', pass: 'hall', age: 52 } ]);
__.all(users, user => user.log());