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.

hinzufuegen.js 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import Component from '@glimmer/component';
  2. import { tracked } from '@glimmer/tracking';
  3. import { action } from '@ember/object';
  4. import { inject as service } from '@ember/service';
  5. export default class HinzufuegenController extends Component {
  6. @tracked titel;
  7. @tracked kategorie;
  8. @tracked menge;
  9. @tracked einheit;
  10. @tracked bild;
  11. @tracked id;
  12. @tracked isselected;
  13. @service store;
  14. @action speichern()
  15. {
  16. this.store.createRecord('produkt', {
  17. type: 'produkt',
  18. id: this.titel.split(' ').join(''),
  19. attributes: {
  20. titel: this.titel,
  21. kategorie: this.kategorie,
  22. menge: this.menge,
  23. einheit: this.einheit,
  24. bild: this.bild,
  25. isselected: false
  26. }
  27. }).save();
  28. this.titel = null;
  29. this.kategorie = null;
  30. this.menge = null;
  31. this.einheit = null;
  32. this.bild = null;
  33. this.id = null;
  34. }
  35. }