Anzeige der Tasks als Liste

This commit is contained in:
jfhr
2020-06-01 15:27:13 +02:00
parent 9d950e9603
commit f52485761e
11 changed files with 97 additions and 551 deletions

View File

@@ -0,0 +1,7 @@
<ul>
<li *ngFor="let task of tasks">
<span>Titel: {{task.titel}}</span>
<br/>
<span>Inhalt: {{task.inhalt}}</span>
</li>
</ul>

View File

@@ -0,0 +1,20 @@
import { Component, OnInit } from '@angular/core';
import { BackendService, Task } from '../services/backend.service';
@Component({
selector: 'app-task-list',
templateUrl: './task-list.component.html',
styleUrls: ['./task-list.component.css']
})
export class TaskListComponent implements OnInit {
public tasks: Task[] = [];
constructor(private backendService: BackendService) {
backendService.getTasks().subscribe(t => this.tasks.push(...t));
}
ngOnInit(): void {
}
}