Store in GIT
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
"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 reader_class_1 = require("../../../classes/reader.class");
|
||||
var plane_class_1 = require("../../../classes/plane.class");
|
||||
var data_service_1 = require("./../../../services/data.service");
|
||||
var EditReaderFormComponent = (function () {
|
||||
function EditReaderFormComponent(data) {
|
||||
this.data = data;
|
||||
this.submitted = false;
|
||||
this.planes = new Array();
|
||||
this.planes = new Array();
|
||||
}
|
||||
EditReaderFormComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this.reader = new reader_class_1.Reader(this.model.id, this.model.reader_id, this.model.plane);
|
||||
this.data.load().then(function () {
|
||||
_this.data
|
||||
.planes()
|
||||
.subscribe(function (response) {
|
||||
for (var i = 0; i < response.data.length; i++) {
|
||||
var temp = plane_class_1.Plane.toPlane(response.data[i]);
|
||||
_this.planes.push(temp);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
EditReaderFormComponent.prototype.onSubmit = function () {
|
||||
var _this = this;
|
||||
this.model.plane = this.reader.plane;
|
||||
this.submitted = true;
|
||||
this.data.load().then(function () {
|
||||
_this.data.editReader(_this.model).subscribe(function (b) { return _this.temp = JSON.stringify(b); });
|
||||
console.log(_this.temp);
|
||||
});
|
||||
};
|
||||
return EditReaderFormComponent;
|
||||
}());
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata("design:type", reader_class_1.Reader)
|
||||
], EditReaderFormComponent.prototype, "model", void 0);
|
||||
EditReaderFormComponent = __decorate([
|
||||
core_1.Component({
|
||||
selector: 'edit-reader-form',
|
||||
templateUrl: './edit-reader-form.component.html'
|
||||
}),
|
||||
__metadata("design:paramtypes", [data_service_1.DataService])
|
||||
], EditReaderFormComponent);
|
||||
exports.EditReaderFormComponent = EditReaderFormComponent;
|
||||
//# sourceMappingURL=edit-reader-form.component.js.map
|
||||
Reference in New Issue
Block a user