UNPKG

ng2-bootstrap

Version:
18 lines 656 B
/*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); } } }); }; } //# sourceMappingURL=decorators.js.map