# Functions should be invoked in event bindings.

This diagnostic detects uninvoked functions in event bindings.

```angular-ts
import {Component, signal, Signal} from '@angular/core';

@Component({
  template: `<button (click)="(onClick)">Click me</button>`,
})
class MyComponent {
  onClick() {
    console.log('clicked');
  }
}
```

## What's wrong with that?

Functions in event bindings should be invoked when the event is triggered.
If the function is not invoked, it will not execute when the event is triggered.

## What should I do instead?

Ensure to invoke the function when you use it in an event binding to execute the function when the event is triggered.

```angular-ts
import {Component} from '@angular/core';

@Component({
  template: `<button (click)="onClick()">Click me</button>`,
})
class MyComponent {
  onClick() {
    console.log('clicked');
  }
}
```

## Configuration requirements

[`strictTemplates`](tools/cli/template-typecheck#strict-mode) must be enabled for any extended diagnostic to emit.
`uninvokedFunctionInEventBinding` has no additional requirements beyond `strictTemplates`.

## What if I can't avoid this?

This diagnostic can be disabled by editing the project's `tsconfig.json` file:

```json
{
  "angularCompilerOptions": {
    "extendedDiagnostics": {
      "checks": {
        "uninvokedFunctionInEventBinding": "suppress"
      }
    }
  }
}
```

See [extended diagnostic configuration](extended-diagnostics#configuration) for more info.
