38 lines
1.9 KiB
JavaScript
38 lines
1.9 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 PlaneFormComponent = (function () {
|
|
function PlaneFormComponent(data) {
|
|
this.data = data;
|
|
this.roles = ['Pilot', 'Student', 'Instructor'];
|
|
this.submitted = false;
|
|
this.plane = new plane_class_1.Plane(0, "", "", "", "");
|
|
}
|
|
PlaneFormComponent.prototype.onSubmit = function () {
|
|
var _this = this;
|
|
this.submitted = true;
|
|
this.data.load().then(function () {
|
|
_this.data.postPlane(_this.plane).subscribe(function (b) { return _this.temp = JSON.stringify(b); });
|
|
});
|
|
};
|
|
return PlaneFormComponent;
|
|
}());
|
|
PlaneFormComponent = __decorate([
|
|
core_1.Component({
|
|
selector: 'plane-form',
|
|
templateUrl: './plane-form.component.html'
|
|
}),
|
|
__metadata("design:paramtypes", [data_service_1.DataService])
|
|
], PlaneFormComponent);
|
|
exports.PlaneFormComponent = PlaneFormComponent;
|
|
//# sourceMappingURL=plane-form.component.js.map
|