ng-dap
Version:
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8.
21 lines • 724 B
JavaScript
/*tslint:disable:no-invalid-this */
export function OnChange(defaultValue) {
var sufix = 'Change';
return function OnChangeHandler(target, propertyKey) {
var _key = " __" + propertyKey + "Value";
Object.defineProperty(target, propertyKey, {
get: function () {
return this[_key];
},
set: function (value) {
var prevValue = this[_key];
this[_key] = value;
if (prevValue !== value && this[propertyKey + sufix]) {
this[propertyKey + sufix].emit(value);
}
}
});
};
}
/* tslint:enable */
//# sourceMappingURL=decorators.js.map