Skip to content

Commit

Permalink
fix: error with OutsideEventPlugin that would lead to calling undefin…
Browse files Browse the repository at this point in the history
…ed function (#379)

Fixes #239
  • Loading branch information
erzaehlsalex authored and shlomiassaf committed Aug 15, 2017
1 parent 590c9bc commit c313962
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ngx-modialog/src/providers/outside-event-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ export class DOMOutsideEventPlugin { // extends EventManagerPlugin
return zone.runOutsideAngular(() => {
let fn: Function;
setTimeout(() => fn = onceOnOutside(), 0);
return () => fn();
return () => {
if (fn) fn();
};
});
}

Expand Down

0 comments on commit c313962

Please sign in to comment.