有人用过backbone-validation.js这个插件吗?

var SomeModel = Backbone.Model.extend({
  validation: {
    email: {
      required: true,
      pattern: 'email',
      msg: 'Please enter a valid email'
    }
  },

  validate: function(attr){
    console.log(attr);
  }
});

var some = new SomeModel();
some.set('email', 'test', {validate: true});
console.log(some);

能帮忙写个例子出来吗?我按照说明写了个测试,不知道怎么取到错误信息呢?

查看回复