Skip to content

If an html template calls a method with more arguments than there are expected params, the arguments should be removed #2

@gregjacobs

Description

@gregjacobs

That is, unless the method leverages the arguments variable.

Example of this issue:

html:

<div (click)="doSomething( $event )">

ts:

public doSomething() {  // <-- no parameter
    // ...
}

This causes a TypeScript error on AOT compilation: "Expected 0 arguments, but got 1"

Thinking that the argument in the HTML should be removed to make:

<div (click)="doSomething()">

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions