|
|
@@ -32,17 +32,59 @@ export class BlogCreateComponent implements OnInit { |
|
|
|
console.log(value); |
|
|
|
} |
|
|
|
|
|
|
|
createBlogEntry(title: string, image: string, kategorie: string, menge: string, kommentar: string, ) { |
|
|
|
if (title && image && kommentar && kategorie) { |
|
|
|
createBlogEntry(einkaufsort: string, menge: string, kommentar: string, ) { |
|
|
|
if (einkaufsort && kommentar) { |
|
|
|
const entry = new BlogEntry(); |
|
|
|
entry.einkaufsort = title; |
|
|
|
entry.image = image; |
|
|
|
entry.kategorie = kategorie; |
|
|
|
entry.einkaufsort = einkaufsort; |
|
|
|
entry.menge = menge; |
|
|
|
entry.kommentar = kommentar; |
|
|
|
|
|
|
|
if(einkaufsort === 'Aldi Süd'){ |
|
|
|
entry.image = 'https://www.horizont.net/news/media/20/Logo-Aldi-Sd-2017-198042-detailnp.jpeg'; |
|
|
|
entry.kategorie = 'Lebensmittel'; |
|
|
|
} |
|
|
|
else if (einkaufsort === 'Edeka') { |
|
|
|
entry.image = 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Logo_Edeka.svg/1200px-Logo_Edeka.svg.png'; |
|
|
|
entry.kategorie = 'Lebensmittel';} |
|
|
|
else if (einkaufsort == 'Lidl') { |
|
|
|
entry.image = 'https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Lidl-Logo.svg/1200px-Lidl-Logo.svg.png'; |
|
|
|
entry.kategorie = 'Lebensmittel';} |
|
|
|
else if (einkaufsort == 'Rewe') { |
|
|
|
entry.image = 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Logo_REWE.svg/1200px-Logo_REWE.svg.png'; |
|
|
|
entry.kategorie = 'Lebensmittel';} |
|
|
|
else if (einkaufsort == 'Netto') { |
|
|
|
entry.image = 'https://www.netto-online.de/images/favicons/logo_netto.png'; |
|
|
|
entry.kategorie = 'Lebensmittel';} |
|
|
|
else if (einkaufsort == 'Penny') { |
|
|
|
entry.image = 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/Penny-Markt.svg/1200px-Penny-Markt.svg.png'; |
|
|
|
entry.kategorie = 'Lebensmittel';} |
|
|
|
else if (einkaufsort == 'DM') { |
|
|
|
entry.image = 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Dm_Logo.svg/1200px-Dm_Logo.svg.png'; |
|
|
|
entry.kategorie = 'Drogerie';} |
|
|
|
else if (einkaufsort == 'Rossmann') { |
|
|
|
entry.image = 'https://www.einkaufsbahnhof.de/wp-content/uploads/2018/03/rossmann_logo_schreibschrift.png'; |
|
|
|
entry.kategorie = 'Drogerie';} |
|
|
|
else if (einkaufsort == 'Müller') { |
|
|
|
entry.image = 'https://www.e-einz.de/wp-content/uploads/2017/02/Mueller.png'; |
|
|
|
entry.kategorie = 'Drogerie';} |
|
|
|
else if (einkaufsort == 'OBI') { |
|
|
|
entry.image = 'https://media.aubi-plus.com/files/premiumprofil/logo/35d8961-obi.jpg'; |
|
|
|
entry.kategorie = 'Baumarkt';} |
|
|
|
else if (einkaufsort == 'Dehner') { |
|
|
|
entry.image = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Dehner.svg/1200px-Dehner.svg.png'; |
|
|
|
entry.kategorie = 'Garten-Center';} |
|
|
|
else if (einkaufsort == 'Hornbach') { |
|
|
|
entry.image = 'https://www.luvshopping.de/-/media/images/b2c/germany/lubeck/logo-stores/hornbach.jpg?h=442&la=de-DE&mw=650&w=650&hash=C6C36C2C1536745108FF620D3B9CD7E4864A9308'; |
|
|
|
entry.kategorie = 'Baumarkt';} |
|
|
|
else if (einkaufsort == 'Anderer') { |
|
|
|
entry.image = 'https://previews.123rf.com/images/krisdog/krisdog1312/krisdog131200065/24639132-ein-beispiel-f%C3%BCr-ein-einkaufswagen-oder-einkaufswagen-symbol.jpg'; |
|
|
|
entry.kategorie = 'Unbekannt';}; |
|
|
|
|
|
|
|
this.entries.push(entry); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
deleteAllEntries() { |
|
|
|
console.log(this.entries.length); |
|
|
|
const index: number = this.entries.length; |