fix(angular): backButton event uses ionBackButton

This commit is contained in:
Manu Mtz.-Almeida
2018-10-02 13:14:37 +02:00
parent 657c2edc4d
commit 0337c7f567
3 changed files with 13 additions and 11 deletions

View File

@ -1,4 +1,4 @@
import { ElementRef } from '@angular/core';
import { ElementRef, EventEmitter } from '@angular/core';
export function inputs(instance: any, el: ElementRef, props: string[]) {
props.forEach(propName => {
@ -8,9 +8,9 @@ export function inputs(instance: any, el: ElementRef, props: string[]) {
});
}
export function proxyEvent(emitter: any, el: EventTarget, eventName: string) {
export function proxyEvent<T>(emitter: EventEmitter<T>, el: EventTarget, eventName: string) {
el.addEventListener(eventName, (ev) => {
emitter.emit(ev);
emitter.emit((ev as any).detail as T);
});
}