Skip to content

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

Open

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()">

Activity

  1. gregjacobs commented on Jul 20, 2018

    @gregjacobs
    OwnerAuthor

    Make sure to look in component superclasses for the method as well if it doesn't exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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