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 2.1KB

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