Skip to content

Create OnUiParamsChanged, OnUiExit interfaces instead of Ng2Component #788

@stnor

Description

@stnor

It would be nice with separate interface exports for the hooks, and with a nice naming, such as:

export interface MyComponent implements OnUiExit {
   uiCanExit(newTransition?: Transition): HookResult {
   }
}

As it is right now the NG2Component interface really does not add any declarative meaning for a person using the framework, imho:

export interface MyComponent implements Ng2Component {
}

I don't get why a user-exposed interface has this design with all optional methods. I feel that its better to have one interface per hook and not use the optional (?) syntax.

export interface Ng2Component extends Component {

   uiOnParamsChanged?(newParams: {
        [paramName: string]: any;
       }, trans?: Transition): void;

   uiCanExit?(newTransition?: Transition): HookResult;
}

Any chance of getting this? I could create my own interfaces, but feel it's better if it's in the framework. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions