I wrote this lib to find once component boundary size change (resize) in Angular, may this help other people. You may put it on the root component, will do the same thing as window resize.
Step 1: Import the module
import { BoundSensorModule } from 'angular-bound-sensor';@NgModule({ (...) imports: [ BoundSensorModule, ],})export class AppModule { }
Step 2: Add the directive like below
<simple-component boundSensor></simple-component>
Step 3: Receive the boundary size details
import { HostListener } from '@angular/core';@Component({ selector: 'simple-component' (...)})class SimpleComponent { @HostListener('resize', ['$event']) onResize(event) { console.log(event.detail); }}