Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Implement lifecycle hooks for directive/component controllers (ng2-style) #14030

Closed
@gkalpak

Description

@gkalpak

I open this issue in order to track/discuss the implementation of lifecucle hooks to directive/component controllers.

Context

In our attempt to improve the upgrade path to Angular 2, it makes sense to allow developers structure their directive/component controllers is a way that is as easy as possible to migrate them to Angular 2 (ideally, there should be no modification of the controllers code necessary).
As part of this attempt, it will be useful to implement some of the lifecycle hooks available in Angular 2. (Obviously, it isn't necessary (or possible) to implement all of them, due to differences between ng1/ng2 internals.)

Lifecycle Hooks

UPDATE:
Since we can't match the semantics of AfterView/ContentInit closely enough, we implemented a $postLink hook instead, which is close (but not the same) and fits ng1 semantics better.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions