UNPKG

mframejs

Version:
29 lines 985 B
import * as tslib_1 from "tslib"; import { customAttribute } from '../decorator/exported'; import { BindingEngine } from '../binding/exported'; let ModelAttribute = class ModelAttribute { created() { this.$attribute.getContent = () => { return this; }; this.expression = this.$attribute.value; this.subscribeInternal = { name: 'modelAttribute:', value: this.value, call: (newValue, oldValue) => { if (oldValue !== newValue) { this.value = newValue; } } }; BindingEngine.subscribeClassProperty(this.$bindingContext, this.expression, this.subscribeInternal); } detached() { this.$attribute.getContent = null; } }; ModelAttribute = tslib_1.__decorate([ customAttribute('model.bind') ], ModelAttribute); export { ModelAttribute }; //# sourceMappingURL=modelAttribute.js.map