Fix some angular (#16615)

* fix(angular): platform types

fixes #16535

* fix(angular): memory leak in lifecycle events

fixes #16285

* fix ci

* single core
This commit is contained in:
Manu MA
2018-12-06 22:19:35 +01:00
committed by GitHub
parent 119e0c1fd2
commit edf3659949
4 changed files with 44 additions and 28 deletions

View File

@ -1,4 +1,5 @@
import { ElementRef, EventEmitter } from '@angular/core';
import { ElementRef } from '@angular/core';
import { Subject } from 'rxjs';
export function inputs(instance: any, el: ElementRef, props: string[]) {
props.forEach(propName => {
@ -8,13 +9,12 @@ export function inputs(instance: any, el: ElementRef, props: string[]) {
});
}
export function proxyEvent<T>(emitter: EventEmitter<T>, el: EventTarget, eventName: string) {
export function proxyEvent<T>(emitter: Subject<T>, el: EventTarget, eventName: string) {
el.addEventListener(eventName, (ev) => {
emitter.emit(ev ? (ev as any).detail as T : undefined);
emitter.next(ev ? (ev as any).detail as T : undefined);
});
}
export function proxyMethod(ctrlName: string, methodName: string, ...args: any[]) {
const controller = ensureElementInBody(ctrlName);
return controller.componentOnReady()