0.1.2 • Published 10 years ago

bindable-schema v0.1.2

Weekly downloads
32
License
BSD
Repository
github
Last release
10 years ago
var person   = new BindableObject(),
personSchema = new BindableSchema({
  username: {
    $validate: [    
      { min: 6, error: { message: "Username must be at least 6 characters" } },
      checkUsername
    ]
  }
});

personSchema.use(bindableSchemaValidator);


//create a watcher of a particular bindable object
var personWatcher = personSchema.attach(person);

//when the person changes, the fields will 
person.set("username", "abba");

personWatcher.get("username.$valid"); // Username must be at least 6 characters
personWatcher.get("valid.$error"); // false
personWatcher.get("$valid"); // false

//set username that exists
person.set("username", "craigonator");

//after N seconds
personWatcher.get("fields.username.error"); // username exists
0.1.2

10 years ago

0.1.0

10 years ago

0.0.15

10 years ago

0.0.14

11 years ago

0.0.12

11 years ago

0.0.11

11 years ago

0.1.1

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.0

11 years ago