Dynamic module bservable

Index

Functions

Functions

observable(obj: any, property: string): KnockoutObservable

Parameters

  • obj: any
  • property: string

Returns

KnockoutObservable

convertObject(obj: any)

Converts an entire object into an observable object by re-writing its attributes using ES5 getters and setters. Attributes beginning with '_' or '$' are ignored.

Parameters

  • obj: any

    The target object to convert.

convertProperty(obj: any, propertyName: string, original?: any): KnockoutObservable

Converts a normal property into an observable property using ES5 getters and setters.

Parameters

  • obj: any

    The target object on which the property to convert lives.

  • propertyName: string

    The name of the property to convert.

  • original?: any optional

Returns

KnockoutObservable

The underlying observable.

defineProperty(obj: any, propertyName: string, evaluatorOrOptions?: KnockoutComputedDefine): any

Defines a computed property using ES5 getters and setters.

Parameters

  • obj: any

    The target object on which to create the property.

  • propertyName: string

    The name of the property to define.

  • evaluatorOrOptions?: KnockoutComputedDefine optional

    The Knockout computed function or computed options object.

Returns

any

The underlying computed observable.

install(config: Object)

Installs the plugin into the view model binder's beforeBind hook so that objects are automatically converted before being bound.

Parameters

  • config: Object