Add ng-bootstrap, implement task form modal window
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="Title">Titel</label>
|
||||
<input type="text" class="form-control" id="Title" required [(ngModel)]="title">
|
||||
<input type="text" class="form-control" id="Title" required name="title" [(ngModel)]="title">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="Inhalt">Inhalt</label>
|
||||
<input type="text" class="form-control" id="Content" required [(ngModel)]="content">
|
||||
<input type="text" class="form-control" id="Content" required name="content" [(ngModel)]="content">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { BackendService, Task } from '../services/backend.service';
|
||||
|
||||
@Component({
|
||||
@@ -15,7 +16,7 @@ export class TaskFormComponent implements OnInit {
|
||||
public task: Task;
|
||||
private submitted: boolean;
|
||||
|
||||
constructor(private backendService: BackendService) { }
|
||||
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.task !== null && this.task !== undefined) {
|
||||
@@ -35,5 +36,6 @@ export class TaskFormComponent implements OnInit {
|
||||
this.backendService.postTask(this.task);
|
||||
}
|
||||
this.submitted = true;
|
||||
this.activeModalService.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user