fix(angular): always dispatch lifecycle events

This commit is contained in:
Manu Mtz.-Almeida
2018-07-25 16:29:44 +02:00
parent 8492c19195
commit 5677daa324

View File

@ -106,7 +106,7 @@ const LIFECYCLES = [
export function bindLifecycleEvents(instance: any, element: HTMLElement) {
LIFECYCLES.forEach(eventName => {
element.addEventListener(eventName, (ev: any) => {
if (typeof instance[eventName] === 'function' && ev.detail) {
if (typeof instance[eventName] === 'function') {
instance[eventName](ev.detail);
}
});