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
Provide Event Names: Add one or more event names as string arguments to the
updateTriggerbehavior, separated by colons (:). The behavior will then listen for these specified events on the element to trigger updates.Remove Behavior: If you want the default update behavior for the element (e.g., 'input' and 'change' events for
<input>), simply remove the& updateTriggerbehavior altogether.
Example
<!-- 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">// View Model
import { customElement } from 'aurelia';
@customElement({ /* ... */ })
export class MyComponent {
firstName = '';
lastName = '';
searchTerm = '';
middleName = '';
notes = '';
}Debugging Tips
Verify that the
& updateTriggersyntax 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.
Last updated
Was this helpful?