\ No newline at end of file
diff --git a/src/app/userstory-form/userstory-form.component.ts b/src/app/userstory-form/userstory-form.component.ts
new file mode 100644
index 0000000..4fe28be
--- /dev/null
+++ b/src/app/userstory-form/userstory-form.component.ts
@@ -0,0 +1,52 @@
+import { Component, OnInit, Input } from '@angular/core';
+import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
+import { BackendService, ScrumUserstory, Priority } from '../services/backend.service';
+
+@Component({
+ selector: 'app-userstory-form',
+ templateUrl: './userstory-form.component.html',
+ styleUrls: ['./userstory-form.component.css']
+})
+export class UserstoryFormComponent implements OnInit {
+
+ public title: string;
+ public content: string;
+ public prio: Priority;
+
+ @Input()
+ public userstory: ScrumUserstory;
+ private submitted: boolean;
+
+ constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { }
+
+ ngOnInit(): void {
+ if (this.userstory !== null && this.userstory !== undefined) {
+ this.title = this.userstory.title;
+ this.content = this.userstory.content;
+ this.prio = this.userstory.priority;
+ }
+ }
+
+ onSubmit() {
+ if (this.userstory !== null && this.userstory !== undefined) {
+ this.userstory.title = this.title;
+ this.userstory.content = this.content;
+ this.userstory.priority = this.prio;
+ this.backendService.putUserstory(this.userstory).subscribe(response => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ });
+ }
+ else {
+ this.userstory = { title: this.title, content: this.content, priority: this.prio };
+ this.backendService.postUserstory(this.userstory).subscribe(response => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ });
+ }
+ this.submitted = true;
+ this.activeModalService.close(this.userstory);
+ }
+}
diff --git a/src/app/userstory-list/userstory-list.component.html b/src/app/userstory-list/userstory-list.component.html
index e69de29..fbee073 100644
--- a/src/app/userstory-list/userstory-list.component.html
+++ b/src/app/userstory-list/userstory-list.component.html
@@ -0,0 +1,14 @@
+