resize
Created by Tomer
Import
resize
entry point exposes 2 symbols:
injectResize()
: a CIF that observes the resize event on the Host element of the componentNgxResize
: a directive that can observe the resize event of any element that it is attached on
Both emit resize result outside of Angular Zone by default but both provide way to configure the behavior.
Usage
injectResize
injectResize
returns an Observable<ResizeResult>
(see ResizeResult TBD)
NgxResize
If you are not a fan of inject()
, you can also use NgxResize
on the Host element by leveraging hostDirectives
ResizeOptions
We can pass in specific ResizeOptions
to each approach:
To provide ResizeOptions
globally to the application or to a sub component tree (via Route#providers
), we can use provideResizeOptions()