![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@ng-web-apis/resize-observer
Advanced tools
A library for declarative use of Resize Observer API with Angular
This is a library for declarative use of Resize Observer API with Angular.
If you do not have @ng-web-apis/common:
npm i @ng-web-apis/common
Now install the package:
npm i @ng-web-apis/resize-observer
ResizeObserverModule
to the module where you plan to use it.waResizeObserver
directive to observe an element:<section>
<h1
waResizeBox="content-box"
(waResizeObserver)="onResize($event)"
>
I'm being observed
</h1>
</section>
Use waResizeBox
to configure
ResizeObserver options
NOTE: Keep in mind these are used one time in constructor so you cannot use binding, only strings.
Alternatively you can use Observable
-based ResizeObserverService
and provide token RESIZE_OPTION_BOX
manually:
@Component({
selector: 'my-component',
providers: [
ResizeObserverService,
{
provide: RESIZE_OPTION_BOX,
useValue: 'border-box',
},
],
})
export class Example {
constructor(@Inject(ResizeObserverService) entries$: ResizeObserverService) {
entries$.subscribe((entries) => {
// This will trigger when the component resizes
// Don't forget to unsubscribe
console.log(entries);
});
}
}
![]() | ![]() | ![]() | ![]() | ![]() |
---|---|---|---|---|
79+ | 69+ | 64+ | 13.1+ | 13.4+ |
You can use polyfill to support older browsers
You can try online demo here
Other Web APIs for Angular by @ng-web-apis
FAQs
A library for declarative use of Resize Observer API with Angular
The npm package @ng-web-apis/resize-observer receives a total of 0 weekly downloads. As such, @ng-web-apis/resize-observer popularity was classified as not popular.
We found that @ng-web-apis/resize-observer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.