You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.component.html 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <h1>Einkaufszettel</h1>
  2. <app-blog-entry *ngFor="let entry of entries" [entry]="entry"></app-blog-entry>
  3. <h2>Neuen Einkaufszettel Eintrag anlegen:</h2>
  4. <div class="form">
  5. <div class="control">
  6. <label for="title">Titel:</label>
  7. <input type="text" id="title" #title/>
  8. </div>
  9. <div class="control">
  10. <label for="title">Bild-URL:</label>
  11. <input type="text" id="image" #image/>
  12. </div>
  13. <div class="container">
  14. <div class="row custom-wrapper">
  15. <div class="col-md-12">
  16. <!-- Form starts -->
  17. <form [formGroup]="registrationForm" (ngSubmit)="onSubmit()">
  18. <div class="group-gap">
  19. <div class="d-block my-3">
  20. <div class="mb-3">
  21. <select class="custom-select" (change)="changeKategorie($event)" formControlName="kategorieName">
  22. <option value="">Wählen sie eine Kategorie</option>
  23. <option *ngFor="let kategorie of Kategorien" [ngValue]="kategorie">{{kategorie}}</option>
  24. </select>
  25. <!-- error block -->
  26. <div class="invalid-feedback" *ngIf="isSubmitted && kategorieName.errors?.required">
  27. <sup>*</sup>Bitte geben sie eine Kategorie ein!
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <!-- Submit Button -->
  33. <button type="submit" class="btn btn-danger btn-lg btn-block">Speichern</button>
  34. </form><!-- Form ends -->
  35. </div>
  36. </div>
  37. </div>
  38. <div class="control">
  39. <label for="title">Kategorie:</label>
  40. <input type="text" id="kategorie" #kategorie/>
  41. </div>
  42. <div class="control">
  43. <label for="text">Text:</label>
  44. <textarea id="text" cols="20" rows="3" #text>
  45. </textarea>
  46. </div>
  47. <div>
  48. <button (click)="createBlogEntry(title.value, image.value, kategorie.value, text.value)">
  49. Blog-Eintrag anlegen
  50. </button>
  51. </div>
  52. </div>