DirectiveOptional

wrClickOutside

Emit when a mousedown lands outside the element, to close a popup or an inline edit.

Installation

Import the class. This entry point has no stylesheet.

import { Component } from '@angular/core';
import { WrClickOutside } from 'ngwr/directives';

@Component({ imports: [WrClickOutside] })
export class MyComponent {}

Usage

<div class="popup" (wrClickOutside)="close()"> … </div>
Click outside this box (count: 0)

API

NameDescriptionTypeDefault
(wrClickOutside)Emits on a mousedown outside the host.MouseEvent—

See also