projects/ngx-observers/src/lib/resize.directive.ts
ResizeDirective
Allow observe resize event of given object
Example:
<div (obsResize)="resize($event)" [obsOptions]="{box: 'content-box'}" #elem="directive">...</div>
Selector | [obsResize] |
Properties |
Inputs |
Outputs |
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 |
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 |
observer |
Type : ResizeObserver | undefined
|
Original observer object You can access observer within your controller using @ViewChild Example:
Detailed information can be found: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver |