Anzeige der Tasks als Liste
This commit is contained in:
0
src/app/task-list/task-list.component.css
Normal file
0
src/app/task-list/task-list.component.css
Normal file
7
src/app/task-list/task-list.component.html
Normal file
7
src/app/task-list/task-list.component.html
Normal 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>
|
||||
20
src/app/task-list/task-list.component.ts
Normal file
20
src/app/task-list/task-list.component.ts
Normal 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 {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user