12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import Component from '@glimmer/component';
- import { tracked } from '@glimmer/tracking';
- import { action } from '@ember/object';
- import { inject as service } from '@ember/service';
-
- export default class HinzufuegenController extends Component {
-
- @tracked titel;
- @tracked kategorie;
- @tracked menge;
- @tracked einheit;
- @tracked bild;
- @tracked id;
- @tracked isselected;
-
- @service store;
-
- @action speichern()
- {
- let produkt = this.store.createRecord('produkt', {
- type: 'produkt',
- id: this.titel.split(' ').join(''),
- //attributes: {
- titel: this.titel,
- kategorie: this.kategorie,
- menge: this.menge,
- einheit: this.einheit,
- bild: this.bild,
- isselected: false
- //}
- })
-
- //produkt._promiseProxy = true;
- produkt.save();
-
- this.store.findAll('produkt').then(function (suchergebnis) {
- suchergebnis.forEach(element => {
- if (element.titel != undefined) {
-
- }
- });
- });
-
-
- this.titel = null;
- this.kategorie = null;
- this.menge = null;
- this.einheit = null;
- this.bild = null;
- this.id = null;
-
-
-
- }
- }
|