angular / angular/components

feat(CdkObserveContent): Enable observing Resize using ResizeObserver

Open
#23,003 3 comments 4 reactions 0 assignees View on GitHub
area: cdk/observers feature needs: discussion P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Feature Description

It would be great, if the current implementation of CdkObserveContent could be made more generic, so that it could be used for implementing other *Observer APIs.

#### Use Case

On my project, we need to observe the resizing of an element - ResizeObserver is great for this. But it's cumbersome to work with on it's own.

I've added some directives and services that basically just extend and wrap the current CdkObserveContent services and directives, which seems to work, but there's some typecasting and I/O handling that is not very pretty. It looks like it would be a fairly small effort to make the generic parts of the current implementation properly generic, which would make it a breeze to support other observer APIs.

Contributor guide

Open the contributing guide

Research direction

Start by reading the current CdkObserveContent directives and services, then compare their structure with the described ResizeObserver use case. Determine which parts need to become generic so other Observer APIs can be supported, and verify that the existing content-observation behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.