File

projects/ngx-observers/src/lib/resize.directive.ts

Description

ResizeDirective

Allow observe resize event of given object

Example:

<div (obsResize)="resize($event)" [obsOptions]="{box: 'content-box'}" #elem="directive">...</div>

Implements

OnInit OnDestroy

Metadata

Index

Properties
Inputs
Outputs

Inputs

obsOptions
Type : ResizeObserverOptions
Default value : {}

Observer options input

You can pass original observer options via [obsOptions] input, to configure observer behaviour.

Detailed information can be found: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe

Outputs

obsResize
Type : EventEmitter

obsResize output

Emits array of ResizeObserverEntry objects that can be used to access the new dimensions of the element after each change.

Detailed information can be found: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver

Properties

observer
Type : ResizeObserver | undefined

Original observer object

You can access observer within your controller using @ViewChild

Example:

@ViewChild('elem') obsResize: ResizeDirective | undefined; // elem is variable from template (#elem="directive")

Detailed information can be found: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver

results matching ""

    No results matching ""