"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); }; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var initialEntries_1 = require("./initialEntries"); var blog_entry_1 = require("./blog-entry"); var AppComponent = (function () { function AppComponent() { this.entries = []; this.id = 2; this.entries = []; this.entries = initialEntries_1.initialEntries; } AppComponent.prototype.createBlogEntry = function (title, image, text) { this.id++; console.log(this.id, title, image, text); var entry = new blog_entry_1.BlogEntry(); entry.id = this.id; entry.title = title; entry.image = image; entry.text = text; this.entries.push(entry); }; AppComponent.prototype.deleteBlogEntry = function (id) { var entryIndex = this.entries.findIndex(function (entry) { return entry.id === id; }); if (entryIndex > -1) { this.entries.splice(entryIndex, 1); } }; return AppComponent; }()); AppComponent = __decorate([ core_1.Component({ moduleId: module.id, selector: 'app-root', templateUrl: 'app.component.html' }), __metadata("design:paramtypes", []) ], AppComponent); exports.AppComponent = AppComponent; //# sourceMappingURL=app.component.js.map