An alternative to AMagyar's answer. This version works when you click on element that gets removed from the DOM with an ngIf.
http://plnkr.co/edit/4mrn4GjM95uvSbQtxrAS?p=preview
private wasInside = false;_x000D_
_x000D_
@HostListener('click')_x000D_
clickInside() {_x000D_
this.text = "clicked inside";_x000D_
this.wasInside = true;_x000D_
}_x000D_
_x000D_
@HostListener('document:click')_x000D_
clickout() {_x000D_
if (!this.wasInside) {_x000D_
this.text = "clicked outside";_x000D_
}_x000D_
this.wasInside = false;_x000D_
}
_x000D_