ModelBoundView now blows up if there is no model.

pull/4/head
Keivan Beigi 11 years ago
parent 6f8c73771d
commit ba26eadd7e

@ -10,10 +10,17 @@ define(
originalBeforeClose = this.prototype.onBeforeClose;
this.prototype.onRender = function () {
if (this.model) {
if (!this.model) {
throw 'View has no model for binding';
}
if (!this._modelBinder) {
this._modelBinder = new ModelBinder();
this._modelBinder.bind(this.model, this.el);
}
this._modelBinder.bind(this.model, this.el);
if (originalOnRender) {
originalOnRender.call(this);
}

Loading…
Cancel
Save