Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gregjacobs opened this issue Jul 20, 2018 · 1 comment

Comments

@gregjacobs
Copy link
Owner

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()">
@gregjacobs
Copy link
Owner Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant