Skip to content

ResizeObserverService documentation

provided in root

A service wrapping ResizeObserver . This is a service for those reasons: - only one ResizeObserver should be used for performance reason. - For Angular change detection to work, explicit ngZone calls are necessary - Observable stream

Attributes and Methods

NameTypeDefaultDescription
observe(...)
(element: Element, throttle: number, emitInitial: boolean, emitImmediate: boolean) => Observable<ElementDimensions>Observe the size of an element. Returns an observable with the changes.

Parameters
  • element: Element  The element to observe
  • throttle: number  Throttle time in ms. Will emit this time after the resize
  • emitInitial: boolean  Emit the initial size after subscribe?
  • emitImmediate: boolean  Emit an event immediately after the size changes. Useful e.g. for visibility checks.

Types Documentation

Properties
height: number
width: number

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