Documentation
Reference
2.1.50 (current version)
collection
interactivityModel
Interfaces

util.bind

Static function.

Binds the passed function to the passed context.

util.bind(callback, context)

Parameters:

ParameterDefault valueDescription
callback*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Function

Function.

context*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Object

Execution context.

* Mandatory parameter/option.

Example:


var myObject = {
        name: 'test!'
    };
ymaps.geocode.load('Moscow')
    then(ymaps.util.bind(function (res) {
        alert(this.name); // test!
    }, myObject));