Implements task saving and retrieving.

This commit is contained in:
florian
2021-10-20 13:37:45 +02:00
parent c1a7ccb535
commit 89b50142c7
18 changed files with 229 additions and 504 deletions

View File

@@ -0,0 +1,7 @@
<div>
<h1>Todo List</h1>
<div *ngFor="let task of tasks" [title]="task.creationDate">
<h1>{{ task.title }}</h1>
<p>{{ task.description }}</p>
</div>
</div>

View File

@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MainPageComponent } from './main-page.component';
describe('MainPageComponent', () => {
let component: MainPageComponent;
let fixture: ComponentFixture<MainPageComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ MainPageComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(MainPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,21 @@
import { Component, OnInit } from '@angular/core';
import { Task } from '../core/entity/task';
import { TaskService } from '../core/service/task.service';
@Component({
selector: 'app-main-page',
templateUrl: './main-page.component.html',
styleUrls: ['./main-page.component.scss']
})
export class MainPageComponent implements OnInit {
tasks: Task[] = [];
constructor(
private _taskService: TaskService
) {}
ngOnInit(): void {
this._taskService.tasks.subscribe(tasks => this.tasks = tasks);
}
}