1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
import { Component, OnInit } from '@angular/core';
import { TodoListService, TodoItem } from './todo-list.service';
import { trigger, transition, style, animate } from '@angular/animations';
@Component({
selector: 'app-todo-list-page',
templateUrl: './todo-list-page.component.html',
styleUrls: ['./todo-list-page.component.css', './todo-list-color-block.css'],
animations: [
trigger('itemEnter', [
transition(':enter', [
style({
transform: 'translateX(-100%) translateX(-20px)'
}),
animate('400ms ease-out', style({
transform: 'none'
}))
])
])
]
})
export class TodoListPageComponent implements OnInit {
items: TodoItem[] = [];
isLoadCompleted = false;
constructor(private todoService: TodoListService) {
}
ngOnInit() {
this.todoService.getWorkItemList().subscribe({
next: result => this.items.push(result),
complete: () => { this.isLoadCompleted = true; }
});
}
}
|