import { __decorate, __metadata } from "tslib";
import { Input } from '@angular/core';
import { DynamicOutput, PureRelationsComponent } from '@anglr/dynamic/relations';
import { RelationsEditorMetadata } from '@anglr/dynamic/relations-editor';
import { nameof } from '@jscrpt/common';
import { MathAddRelationsMetadataLoader } from './add.metadata';
let MathAddRelations = class MathAddRelations {
    //######################### public methods #########################
    invalidateVisuals() {
    }
    ngOnChanges(changes) {
        if (nameof('input1') in changes ||
            nameof('input2') in changes) {
            if (!this.input1) {
                this.result = this.input2;
                return;
            }
            if (!this.input2) {
                this.result = this.input1;
                return;
            }
            this.result = this.input1 + this.input2;
        }
    }
};
__decorate([
    Input(),
    __metadata("design:type", Object)
], MathAddRelations.prototype, "input1", void 0);
__decorate([
    Input(),
    __metadata("design:type", Object)
], MathAddRelations.prototype, "input2", void 0);
__decorate([
    DynamicOutput(),
    __metadata("design:type", Object)
], MathAddRelations.prototype, "result", void 0);
MathAddRelations = __decorate([
    PureRelationsComponent(),
    RelationsEditorMetadata(MathAddRelationsMetadataLoader)
], MathAddRelations);
export { MathAddRelations };
//# sourceMappingURL=add.relations.js.map