1 | /*tslint:disable:no-invalid-this */
|
2 | export function OnChange(defaultValue) {
|
3 | var sufix = 'Change';
|
4 | return function OnChangeHandler(target, propertyKey) {
|
5 | var _key = " __" + propertyKey + "Value";
|
6 | Object.defineProperty(target, propertyKey, {
|
7 | get: function () { return this[_key]; },
|
8 | set: function (value) {
|
9 | var prevValue = this[_key];
|
10 | this[_key] = value;
|
11 | if (prevValue !== value && this[propertyKey + sufix]) {
|
12 | this[propertyKey + sufix].emit(value);
|
13 | }
|
14 | }
|
15 | });
|
16 | };
|
17 | }
|
18 | //# sourceMappingURL=decorators.js.map |
\ | No newline at end of file |