Skip to content

Emitting outputs in ngOnDestroy (ngBeforeDestroy) #6984

@JurajMlich

Description

@JurajMlich

Let's say I have an object having one property called text. The property is passed into the editor using [text]="object.property". When some changes are present and the editor is destroyed or it loses focus, it emits the changeSave output / event. The parent component then saves the content. The problem is that editor can be focused and simultaneously have some changes, but since the editor has the focus, the changes are not saved yet. But what in case that the editor is destroyed? The blur would not get called and emitting events in ngOnDestroy does not work.

Wouldn't it be a bad idea to implement in Angular something like ngBeforeDestroy, so that events emitted in this method would be truly emitted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimefeatureLabel used to distinguish feature request from other issues

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions