Phone API Reference - Core - exports
Desk Phone API features described in this section are deprecated and supported only on the following models: D40, d45, d50, d60, d62, d65, d70
exports
Object used to provide functions, variables, and properties for use by another script. Use require in another script to obtain the exports in the current script.
Exports will not work if you set exports = to an object (e.g., {"key" : "value" }). You must set properties of the exports object as can be seen in the example.
Require Extended Library:
exports.test = "test"; |
Examples
js example file with exports
var example2 = {};
example2.init = function () {
this.status = 'Status set by example2.init()';
};
example2.getStatus = function () {
return this.status;
};
example2.setStatus = function (param) {
this.status = param;
};
example2.init();
exports.getStatus = example2.getStatus.bind(example2);
exports.setStatus = example2.setStatus.bind(example2); |