Share via


mixin.bind method

Links the specified action to the property specified in the name parameter. This function is invoked when the value of the property may have changed. It is not guaranteed that the action will be called only when a value has actually changed, nor is it guaranteed that the action will be called for every value change. The implementation of this function coalesces change notifications, such that multiple updates to a property value may result in only a single call to the specified action.

Warning  Do not attempt to bind data to the ID of an HTML element.

 

Syntax

var obj = WinJS.Binding.bind(name, action);

Parameters

  • name
    Type: String

    The observable object to bind to.

  • action
    Type: Object

    An object that contains functions to invoke asynchronously when the specified properties in the observable object have changed.

Return value

Type: Object

This object is returned.

Remarks

For more information about how to use binding, see How to bind a complex object.

Requirements

Minimum WinJS version

WinJS 1.0

Namespace

WinJS.Binding

See also

mixin