import Component from '@glimmer/component'; import { on } from '@ember/modifier'; import { tracked } from '@glimmer/tracking'; import { action } from '@ember/object'; export default class PlaceEditForm extends Component { @tracked title = ''; @tracked description = ''; constructor() { super(...arguments); this.title = this.args.place?.title || ''; this.description = this.args.place?.description || ''; } @action handleSubmit(event) { event.preventDefault(); if (this.args.onSave) { this.args.onSave({ title: this.title, description: this.description, }); } } @action updateTitle(e) { this.title = e.target.value; } @action updateDescription(e) { this.description = e.target.value; } }