You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

angular-resize-event-package

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-resize-event-package

Angular directive for detecting changes of an element size.

3.7.0
latest
Source
npmnpm
Version published
Weekly downloads
1.9K
5.92%
Maintainers
1
Weekly downloads
 
Created
Source

Angular Resize Event

Angular directive for detecting changes of an element size.

Important

Forked from: https://github.com/vdolek/angular-resize-event. The last original version is not supported by angular 16, 17, 18, 19, 20 and so on.

Thanks to: https://github.com/vdolek, https://github.com/dereekb, and all contributors.

It is as simple as:

<div (resized)="onResized($event)"></div>

It internally uses browser native ResizeObserver. Therefore it is not supported in IE.

Using the library

Import the library in any Angular application by running:

$ npm install angular-resize-event-package

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

// Import the library module
import { AngularResizeEventModule } from 'angular-resize-event-package';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,

    // Specify AngularResizeEventModule library as an import
    AngularResizeEventModule
  ],
  providers: [],
  bootstrap: [ AppComponent ]
})
export class AppModule { }

Once your library is imported, you can use its resized directive in your Angular application:

<div (resized)="onResized($event)"></div>
import { Component } from '@angular/core';

// Import the resized event model
import { ResizedEvent } from 'angular-resize-event-package';

@Component({...})
class MyComponent {
  width: number;
  height: number;

  onResized(event: ResizedEvent) {
    this.width = event.newRect.width;
    this.height = event.newRect.height;
  }
}

License

MIT © Laszlo Nemes

Keywords

angular

FAQs

Package last updated on 08 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts