Docs (4.0.0)
class Binding method

equals

Adds a filter, to compare the bound value with another bound value.

equals(source: Binding | string): Binding<boolean>

Summary

This method can be used to compare two bindings. If the original value matches the value of the provided binding, the bound value becomes true, otherwise false.

To do the opposite, and substitute with false if the bindings match, use the not() method afterwards.

Parameters

  • source — Another instance of Binding, or a source path that will be passed to bound()

Return value

A new binding, typed as a boolean

Example

// A cell that's rendered only if two bindings match
ui.conditional(
  { state: bound("item").equals("selectedItem") },
  ui.cell(
    // ...
  )
)

Related