Skip to content

SiResizeObserverDirective documentation

selector
[siResizeObserver]

Directive to emit events on element size change. Use like this: <​div (siResizeObserver)="handleResize($event)"​> When the size of the element changes, an event in the format { width: number, height: number } will be emitted. Also an initial event will be emitted on init.

By default, events are throttled and to an event every 100ms. To change this, add [resizeThrottle]="200" on the same element. Input in milliseconds.

Input Properties

NameTypeDefaultDescription
emitInitial
booleantrue
resizeThrottle
number100

Output Properties

NameTypeDescription
siResizeObserver
ElementDimensions

Types Documentation

Properties
height: number
width: number

Except where otherwise noted, content on this site is licensed under MIT License.