mixin.bind method

Applies to Windows and Windows Phone

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 supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.Binding

Library

Base.js

See also

mixin

 

 

Show:
© 2014 Microsoft. All rights reserved.