# AUR0818

## Error Message

`AUR0818: "& signal" invalid usage. At least one signal name must be passed to the signal behavior, e.g. "expr & signal:'my-signal'"`

## Description

This error occurs when the `& signal` binding behavior is used in a binding expression without providing any signal names as arguments. The purpose of the `signal` behavior is to listen for specific named signals, so it requires at least one signal name to function correctly.

## Cause

The sole cause of this error is using the `signal` binding behavior without specifying which signal(s) it should listen for.

Examples of incorrect usage:

* `${myValue & signal}`
* `value.bind="myProp & signal"`

## Solution

Provide one or more signal names as string arguments to the `& signal` binding behavior. Signal names are separated by colons (`:`).

Examples of correct usage:

* `${myValue & signal:'my-signal-name'}`
* `value.bind="myProp & signal:'signal-a':'signal-b'"`

## Example

```html
<!-- Assume myData should update when 'data-updated' or 'user-changed' signals occur -->

<!-- Incorrect: No signal names provided -->
<p>${myData & signal}</p>

<!-- Correct: Provide one signal name -->
<p>${myData & signal:'data-updated'}</p>

<!-- Correct: Provide multiple signal names -->
<p>${myData & signal:'data-updated':'user-changed'}</p>
```

```typescript
// View Model Example
import { customElement, resolve } from 'aurelia';
import { ISignaler } from '@aurelia/runtime-html';

@customElement({ /* ... */ })
export class MyComponent {
  private signaler = resolve(ISignaler);
  myData = 'Initial Data';
  userInfo = 'User A';

  refreshData() {
    this.myData = `Refreshed at ${new Date().toLocaleTimeString()}`;
    this.signaler.dispatchSignal('data-updated');
  }

  changeUser() {
    this.userInfo = `User ${Math.random() > 0.5 ? 'B' : 'C'}`;
    // Assuming myData calculation depends on userInfo indirectly,
    // we might signal both. Or maybe a different binding listens for 'user-changed'.
    this.signaler.dispatchSignal('user-changed');
    this.signaler.dispatchSignal('data-updated'); // Or re-signal data if it depends on user
  }
}
```

## Debugging Tips

* Locate the binding expression using `& signal` in your template.
* Ensure that you have added at least one colon-separated string literal after `& signal` representing the name(s) of the signal(s) to listen for.
* Verify that the signal names are spelled correctly and match the names used when dispatching signals via `ISignaler.dispatchSignal()`.


---

# 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/aur0818.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.
