我有一个使用Backbone.Validations plugin
.
var LocationModel = Backbone.Model.extend({
validation: {
location_name: {
required : true,
msg : 'A name is required for the location'
}
} // end validation
});
var test = new LocationModel();
test.url = 'http://link-goes-here';
test.save();
似乎在保存事件中,即使需要属性“location_name”,它也会继续保存我的空模型?