fix(angular): fix linting issues

This commit is contained in:
Manu Mtz.-Almeida
2019-07-05 20:32:42 +02:00
parent 1add112be6
commit 7953088418
2 changed files with 6 additions and 9 deletions

View File

@@ -19,7 +19,7 @@ export function appInitialize(config: Config, doc: Document, zone: NgZone) {
jmp: (h: any) => zone.runOutsideAngular(h),
raf: h => {
return zone.runOutsideAngular(() => {
return (win.__zone_symbol__requestAnimationFrame) ? win.__zone_symbol__requestAnimationFrame(h) : requestAnimationFrame(h)
return (win.__zone_symbol__requestAnimationFrame) ? win.__zone_symbol__requestAnimationFrame(h) : requestAnimationFrame(h);
});
},
ael(elm, eventName, cb, opts) {

View File

@@ -114,16 +114,13 @@ const LIFECYCLES = [
];
export function bindLifecycleEvents(instance: any, element: HTMLElement) {
const unregisters = LIFECYCLES.map(eventName => {
const handler = (ev: any) => {
instance[eventName](ev.detail);
};
if (typeof instance[eventName] === 'function') {
const unregisters = LIFECYCLES
.filter(eventName => typeof instance[eventName] === 'function')
.map(eventName => {
const handler = (ev: any) => instance[eventName](ev.detail);
element.addEventListener(eventName, handler);
return () => element.removeEventListener(eventName, handler);
}
return () => { return; };
})
});
return () => unregisters.forEach(fn => fn());
}