@web-atoms/core-docs
Version:
27 lines • 1.25 kB
JavaScript
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "../core/PropertyBinding"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const PropertyBinding_1 = require("../core/PropertyBinding");
/**
* Binds source property to target property with optional two ways
* @param target target whose property will be set
* @param propertyName name of target property
* @param source source to read property from
* @param path property path of source
* @param twoWays optional, two ways {@link IValueConverter}
*/
function bindProperty(vm, target, propertyName, source, path, twoWays) {
const pb = new PropertyBinding_1.PropertyBinding(target, null, propertyName, path, (twoWays && typeof twoWays !== "function") ? true : false, twoWays, source);
return vm.registerDisposable(pb);
}
exports.default = bindProperty;
});
//# sourceMappingURL=bindProperty.js.map