Skip to main content
Version: 2.2.0

Binder – durandal/binder

caution

The interface documentation for this module is incomplete. Declarations may be missing or invalid.

The binder joins an object instance and a DOM element tree by applying databinding and/or invoking binding lifecycle callbacks (binding and bindingComplete).

Variables​

throwOnErrors​

throwOnErrors: boolean = false

Indicates whether or not the binding system should throw errors or not.

  • default – The binding system will not throw errors by default. Instead it will log them.

Functions​

bind​

bind(obj, view: HTMLElement): void

Binds the view, preserving the existing binding context. Optionally, a new context can be created, parented to the previous context.

  • (param) obj – The data to bind to.
  • (param) view – The view to bind.

binding​

binding(data, view: HTMLElement, instruction): void

Called before every binding operation. Does nothing by default.

  • (param) data – The data that is about to be bound.
  • (param) view – The view that is about to be bound.
  • (param) instruction – The object that carries the binding instructions.

bindingComplete​

bindingComplete(data, view, instruction): void

Called after every binding operation. Does nothing by default.

  • (param) data – The data that has just been bound.
  • (param) view – The view that has just been bound.
  • (param) instruction – The object that carries the binding instructions.

bindContext​

bindContext(bindingContext: ko.BindingContext, view: HTMLElement, obj?, dataAlias?: string): void

Binds the view, preserving the existing binding context. Optionally, a new context can be created, parented to the previous context.

getBindingInstruction​

bindingComplete(view: HTMLElement): void

Gets the binding instruction that was associated with a view when it was bound.

  • returns – The object that carries the binding instructions.