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

Wrapper function doesn't return orignal function's result #667

@zzx88991

Description

@zzx88991

I am using ASP.NET Webform (yeah, it is legacy code..) with <asp:UpdatePanel> and <AsyncPostBackTrigger>.
When a button click triggers a async postback, event.onsubmit from <form onsubmit="javascript:return WebForm_OnSubmit();"> will be called and return the validation result. However it is not returned once zone.js wraps the event handler, resulting the request not passing validation.

The source code here shows that the wrapper function doesn't return the result of
https://github.com/angular/zone.js/blob/master/lib/common/utils.ts#L89

const wrapFn = function(event) {
        let result;
        result = fn.apply(this, arguments);

        if (result != undefined && !result) event.preventDefault();
};

Not sure what it the purpose of this code not returning result. Thanks for taking a look.

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