# AUR0802

## Error Message

`AUR0802: "& updateTrigger" invalid usage. This binding behavior requires at least one event name argument: eg <input value.bind="firstName & updateTrigger:'blur'">`

## Description

This error occurs when the `& updateTrigger` binding behavior is used in a binding expression without providing any event names as arguments.

## Cause

The `& updateTrigger` binding behavior is designed to override the default events that trigger updates for a two-way (`.bind`) or `.from-view` binding. It requires you to specify which DOM events should cause the view model property to be updated with the view's value.

If you apply the behavior without specifying any event names (e.g., `<input value.bind="message & updateTrigger">`), the behavior doesn't know which events to listen for, making its usage invalid.

## Solution

1. **Provide Event Names:** Add one or more event names as string arguments to the `updateTrigger` behavior, separated by colons (`:`). The behavior will then listen for these specified events on the element to trigger updates.
2. **Remove Behavior:** If you want the default update behavior for the element (e.g., 'input' and 'change' events for `<input>`), simply remove the `& updateTrigger` behavior altogether.

## Example

```html
<!-- Incorrect: updateTrigger used without any event arguments -->
<input type="text" value.bind="firstName & updateTrigger">
<textarea value.from-view="notes & updateTrigger"></textarea>

<!-- Correct: Specifying 'blur' event to trigger update -->
<input type="text" value.bind="lastName & updateTrigger:'blur'">

<!-- Correct: Specifying multiple events ('keyup' and 'change') -->
<input type="search" value.bind="searchTerm & updateTrigger:'keyup':'change'">

<!-- Correct: Default behavior (no updateTrigger behavior needed) -->
<input type="text" value.bind="middleName">
```

```typescript
// View Model
import { customElement } from 'aurelia';

@customElement({ /* ... */ })
export class MyComponent {
  firstName = '';
  lastName = '';
  searchTerm = '';
  middleName = '';
  notes = '';
}
```

## Debugging Tips

* Verify that the `& updateTrigger` syntax includes at least one event name argument enclosed in single or double quotes, like `& updateTrigger:'myevent'`.
* Ensure event names are separated by colons if multiple are provided: `& updateTrigger:'event1':'event2'`.
* Check for typos in the binding behavior name (`updateTrigger`) and the event names.
* If you don't need custom event triggers, remove the behavior.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aurelia.io/developer-guides/error-messages/runtime-html/aur0802.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
