Skip to content

feat(CdkObserveContent): Enable observing Resize using ResizeObserver #23003

Open
@twjacobsen

Description

@twjacobsen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/observersfeatureThis issue represents a new feature or feature request rather than a bug or bug fixneeds: discussionFurther discussion with the team is needed before proceeding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions