Object.defineProperty(dialogFormCtrl, 'showForm', {
get: function () {
return this.model.showForm;
},
set: function (value) {
this.model.showForm = value;
this.showDialogForm(value);
}
});
Object.defineProperty(dialogFormCtrl.prototype, 'showForm', {
get: function () {
return this.model.showForm;
},
set: function (value) {
this.model.showForm = value;
this.showDialogForm(value);
}
});
angular.min.js:117 TypeError: Cannot set property 'showForm' of undefined
at dialogFormCtrl.set (testOne.js:1791)
at angular.min.js:82
at r (angular.min.js:7)
at ha (angular.min.js:81)
at m (angular.min.js:65)
at g (angular.min.js:58)
at m (angular.min.js:66)
at g (angular.min.js:58)
at m (angular.min.js:66)
at g (angular.min.js:58)
function dialogFormCtrl(testsServiceOne, $mdDialog) {
Object.defineProperty(this, 'showForm', {
get: function () {
return this.model.showForm;
},
set: function (value) {
this.model.showForm = value;
this.showDialogForm(value);
}
});
/**
*
*/
}
dialogFormCtrl.prototype = {
constructor: dialogFormCtrl,
get showForm() {
return this.model.showForm;
},
set showForm(value) {
this.model.showForm = value;
this.showDialogForm(value);
},
};
/**
* Именно нижние две строчки у меня вызывают непонимание, если их не указать то все падает, так как не находит функцию "showDialogForm"
*/
dialogFormCtrl.prototype.showDialogForm = function () {};
dialogFormCtrl.prototype.model = {};