Add ng-bootstrap, implement task form modal window
This commit is contained in:
@@ -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