Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

Collapse: Support for pre/post collapse/expand callbacks #5194

@nonplus

Description

@nonplus

In my application, before expanding a collapsed section, I need to populate the contents. Similarly, after collapsing an expanded section, I'd like to do some cleanup.

It would be great if the uib-collapse supported additional attributes that would be evaluated before and after the collapse animation, e.g. expanding, expanded, collapsing, collapsed. If the "before" attribute (collapsing/expanding) returns a promise, the directive should wait for it to resolve before beginning the collapse/expand animation.

Specifically, I'd like to be able to do something like this:

<div uib-collapse="isOpen" expanding="setupContent()" collapsed="cleanupContent()">
    <!-- complex & expensive content goes here -->
</div>

FWIW, I have an implementation and can create a PR if there is general interest in this...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions