Files
gilze-angular/app/pages/plane/form/edit-plane-form.component.js
T
2026-06-17 16:11:25 +02:00

48 lines
2.4 KiB
JavaScript

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require("@angular/core");
var plane_class_1 = require("../../../classes/plane.class");
var data_service_1 = require("./../../../services/data.service");
var EditPlaneFormComponent = (function () {
function EditPlaneFormComponent(data) {
this.data = data;
this.submitted = false;
}
EditPlaneFormComponent.prototype.ngOnInit = function () {
this.plane = new plane_class_1.Plane(this.plmodel.id, this.plmodel.name, this.plmodel.registration, this.plmodel.model, this.plmodel.comment);
};
EditPlaneFormComponent.prototype.onSubmit = function () {
var _this = this;
this.plmodel.name = this.plane.name;
this.plmodel.registration = this.plane.registration;
this.plmodel.model = this.plane.model;
this.plmodel.comment = this.plmodel.comment;
this.submitted = true;
this.data.load().then(function () {
_this.data.editPlane(_this.plmodel).subscribe(function (b) { return _this.temp = JSON.stringify(b); });
console.log(_this.temp);
});
};
return EditPlaneFormComponent;
}());
__decorate([
core_1.Input(),
__metadata("design:type", plane_class_1.Plane)
], EditPlaneFormComponent.prototype, "plmodel", void 0);
EditPlaneFormComponent = __decorate([
core_1.Component({
selector: 'edit-plane-form',
templateUrl: './edit-plane-form.component.html'
}),
__metadata("design:paramtypes", [data_service_1.DataService])
], EditPlaneFormComponent);
exports.EditPlaneFormComponent = EditPlaneFormComponent;
//# sourceMappingURL=edit-plane-form.component.js.map