mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(angular): fix linting issues
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user