Angular: Member <function-name> is not callable

Just in case it will help someone, I had the same problem and the answer above wasn't even close to the solution. After some attempt, I found out it was caused by a name conflict. I had a template variable with the same name as a method. Angular was trying to invoke the template variable, and it ended up showing that error message. For example:

// template
<form #foo (ngSubmit)="foo()">

// TypeScript
foo() {
...
}

It says:

[Angular] member foo is not callable


I think instead of declaring your download file this way in your component file

downloadFile: any;

You should declare it this way

downloadFile: () => any;

check this out if it helps.

Tags:

Angular