UNPKG

mframejs

Version:
34 lines 1.26 kB
Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var exported_1 = require("../decorator/exported"); var exported_2 = require("../binding/exported"); var ModelAttribute = (function () { function ModelAttribute() { } ModelAttribute.prototype.created = function () { var _this = this; this.$attribute.getContent = function () { return _this; }; this.expression = this.$attribute.value; this.subscribeInternal = { name: 'modelAttribute:', value: this.value, call: function (newValue, oldValue) { if (oldValue !== newValue) { _this.value = newValue; } } }; exported_2.BindingEngine.subscribeClassProperty(this.$bindingContext, this.expression, this.subscribeInternal); }; ModelAttribute.prototype.detached = function () { this.$attribute.getContent = null; }; ModelAttribute = tslib_1.__decorate([ exported_1.customAttribute('model.bind') ], ModelAttribute); return ModelAttribute; }()); exports.ModelAttribute = ModelAttribute; //# sourceMappingURL=modelAttribute.js.map