# BindingObserversToElement

Class · extends [`BindingBase`](https://api.playcanvas.com/pcui/classes/BindingBase.md)

Source: https://github.com/playcanvas/pcui/blob/77ed2b8ba8660c9644049b0d1942652721e7a6c4/src/binding/BindingObserversToElement/index.ts#L21

Provides one way binding between Observers and an [IBindable](https://api.playcanvas.com/pcui/interfaces/IBindable.md) element and Observers. Any
changes from the observers will be propagated to the element.

## Constructors

### constructor

```ts
new BindingObserversToElement(args?: Readonly<BindingObserversToElementArgs>)
```

Creates a new BindingObserversToElement instance.

**Parameters**

- `args` (`Readonly<`[`BindingObserversToElementArgs`](https://api.playcanvas.com/pcui/interfaces/BindingObserversToElementArgs.md)`>`, optional, default `{}`): The arguments.

## Methods

### clone

```ts
clone(): BindingObserversToElement
```

Clone the BindingObserversToElement instance.

**Returns** [`BindingObserversToElement`](https://api.playcanvas.com/pcui/classes/BindingObserversToElement.md)

### link

```ts
link(observers: Observer | Observer[], paths: string | string[]): void
```

Links the specified observers to the specified paths.

**Parameters**

- `observers` (`Observer | Observer[]`): The observer(s).
- `paths` (`string | string[]`): The path(s). The behavior of the binding depends on how many paths are passed.
  If an equal amount of paths and observers are passed then the binding will map each path to each observer at each index.
  If more observers than paths are passed then the path at index 0 will be used for all observers.
  If one observer and multiple paths are passed then all of the paths will be used for the observer (e.g. for curves).

### unlink

```ts
unlink(): void
```

Unlink the binding from its set of observers.

## Inherited from [BindingBase](https://api.playcanvas.com/pcui/classes/BindingBase.md)

- `get applyingChange(): boolean` · `set applyingChange(value: boolean)`
- `get element(): IBindable<unknown>` · `set element(value: IBindable<unknown>)`
- `get historyCombine(): boolean` · `set historyCombine(value: boolean)`
- `get historyEnabled(): boolean` · `set historyEnabled(value: boolean)`
- `get historyName(): string` · `set historyName(value: string)`
- `get historyPostfix(): string` · `set historyPostfix(value: string)`
- `get historyPrefix(): string` · `set historyPrefix(value: string)`
- `get linked(): boolean`
- `get observers(): Observer[]`
- `get paths(): string[]`
- `addValue(value: unknown): void`
- `addValues(values: unknown[]): void`
- `removeValue(value: unknown): void`
- `removeValues(values: unknown[]): void`
- `setValue(value: unknown): void`
- `setValues(values: unknown[]): void`
