Dynamic module binder

Index

Variables

Interfaces

Functions

Variables

binding: (data: any, view: HTMLElement, instruction: 'durandal/binder'.BindingInstruction) => void

Called before every binding operation. Does nothing by default.

param

The data that is about to be bound.

param

The view that is about to be bound.

param

The object that carries the binding instructions.

bindingComplete: (data: any, view: HTMLElement, instruction: 'durandal/binder'.BindingInstruction) => void

Called after every binding operation. Does nothing by default.

param

The data that has just been bound.

param

The view that has just been bound.

param

The object that carries the binding instructions.

throwOnErrors: boolean

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

default

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

Functions

bind(obj: any, view: HTMLElement): BindingInstruction

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

Parameters

  • obj: any

    The data to bind to.

  • view: HTMLElement

    The view to bind.

Returns

BindingInstruction

bindContext(bindingContext: KnockoutBindingContext, view: HTMLElement, obj?: any, dataAlias?: string): BindingInstruction

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

Parameters

  • bindingContext: KnockoutBindingContext

    The current binding context.

  • view: HTMLElement

    The view to bind.

  • obj?: any optional
  • dataAlias?: string optional

Returns

BindingInstruction

getBindingInstruction(view: HTMLElement): BindingInstruction

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

Parameters

  • view: HTMLElement

    The view that was previously bound.

Returns

BindingInstruction

The object that carries the binding instructions.