Comparing version 0.0.7-alpha.3 to 0.0.8
22
index.ts
@@ -30,4 +30,2 @@ export * from './decorators/ng-module'; | ||
const attrBinding = alias ? alias : property; | ||
let callbackCache: Function; | ||
let eventEmitterCache: EventEmitter; | ||
@@ -38,4 +36,8 @@ target.constructor.bindings[privateCallbackName] = `&${attrBinding}`; | ||
set: function (callback: Function) { | ||
if (!this.__callbackCache) { | ||
this.__callbackCache = {}; | ||
} | ||
if (typeof callback === "function") { | ||
callbackCache = callback; | ||
this.__callbackCache[property] = callback; | ||
} | ||
@@ -49,11 +51,17 @@ }, | ||
set: function (eventEmitterInstance) { | ||
if (!this.__eventEmitterCache) { | ||
this.__eventEmitterCache = {}; | ||
} | ||
if (eventEmitterInstance && eventEmitterInstance.subscribe) { | ||
eventEmitterInstance.subscribe(function (eventData: any) { | ||
callbackCache({$event: eventData}); | ||
eventEmitterInstance.subscribe((eventData: any) => { | ||
if (typeof this.__callbackCache[property] === "function") { | ||
this.__callbackCache[property]({$event: eventData}); | ||
} | ||
}); | ||
eventEmitterCache = eventEmitterInstance; | ||
this.__eventEmitterCache[property] = eventEmitterInstance; | ||
} | ||
}, | ||
get: function () { | ||
return eventEmitterCache; | ||
return this.__eventEmitterCache[property]; | ||
}, | ||
@@ -60,0 +68,0 @@ enumerable: true, |
{ | ||
"name": "ng1-shift", | ||
"version": "0.0.7-alpha.3", | ||
"version": "0.0.8", | ||
"description": "Angular 1.5+ decorators for writing Angular2 like.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35560
857