This is a directive for detecting clicks outside of a DOM element where the directive is placed on.
npm i angular2-click-outside and configure SystemJS accordingly.
Using this directive is as easy as:
You can pass the original
MouseEvent to the registered handler as follows:
Angular 2 RC 0 Angular 4+ goto https://www.npmjs.com/package/ng-click-outside