diff --git a/blog-complete/app/blog/app.component.html b/blog-complete/app/blog/app.component.html
index 0f91b43..a01a465 100644
--- a/blog-complete/app/blog/app.component.html
+++ b/blog-complete/app/blog/app.component.html
@@ -1,5 +1,5 @@
diff --git a/blog-complete/dist/blog/app.component.js b/blog-complete/dist/blog/app.component.js
index 96e1816..d95f6a6 100644
--- a/blog-complete/dist/blog/app.component.js
+++ b/blog-complete/dist/blog/app.component.js
@@ -15,17 +15,26 @@ 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) {
- console.log(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([
diff --git a/blog-complete/dist/blog/app.component.js.map b/blog-complete/dist/blog/app.component.js.map
index 8859bef..2143c7f 100644
--- a/blog-complete/dist/blog/app.component.js.map
+++ b/blog-complete/dist/blog/app.component.js.map
@@ -1 +1 @@
-{"version":3,"file":"app.component.js","sourceRoot":"","sources":["../../app/blog/app.component.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAwC;AACxC,mDAAgD;AAChD,2CAAuC;AAOvC,IAAa,YAAY;IAIvB;QAFA,YAAO,GAAgB,EAAE,CAAC;QAGxB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,+BAAc,CAAA;IAC/B,CAAC;IAED,sCAAe,GAAf,UAAgB,KAAY,EAAE,KAAY,EAAE,IAAW;QACrD,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QAChC,IAAI,KAAK,GAAG,IAAI,sBAAS,EAAE,CAAC;QAC5B,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACH,mBAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBY,YAAY;IALxB,gBAAS,CAAC;QACT,QAAQ,EAAE,MAAM,CAAC,EAAE;QACnB,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,oBAAoB;KAClC,CAAC;;GACW,YAAY,CAkBxB;AAlBY,oCAAY"}
\ No newline at end of file
+{"version":3,"file":"app.component.js","sourceRoot":"","sources":["../../app/blog/app.component.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAwC;AACxC,mDAAgD;AAChD,2CAAuC;AAQvC,IAAa,YAAY;IAKvB;QAHA,YAAO,GAAgB,EAAE,CAAC;QAC1B,OAAE,GAAG,CAAC,CAAC;QAGL,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,+BAAc,CAAA;IAC/B,CAAC;IAED,sCAAe,GAAf,UAAgB,KAAY,EAAE,KAAY,EAAE,IAAW;QACrD,IAAI,CAAC,EAAE,EAAE,CAAC;QACV,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,GAAG,IAAI,sBAAS,EAAE,CAAC;QAC5B,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,sCAAe,GAAf,UAAgB,EAAS;QACvB,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,EAAE,KAAK,EAAE,EAAf,CAAe,CAAC,CAAC;QAClE,EAAE,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAEH,mBAAC;AAAD,CAAC,AA7BD,IA6BC;AA7BY,YAAY;IANxB,gBAAS,CAAC;QACT,QAAQ,EAAE,MAAM,CAAC,EAAE;QACnB,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,oBAAoB;KAClC,CAAC;;GAEW,YAAY,CA6BxB;AA7BY,oCAAY"}
\ No newline at end of file
diff --git a/blog-complete/dist/blog/blog-entry.component.html b/blog-complete/dist/blog/blog-entry.component.html
index b034fbf..7e03b48 100644
--- a/blog-complete/dist/blog/blog-entry.component.html
+++ b/blog-complete/dist/blog/blog-entry.component.html
@@ -6,4 +6,7 @@
{{entry.title}}
{{entry.text}}
+