aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-02-24 17:04:29 +0000
committer杨宇千 <crupest@outlook.com>2019-02-24 17:04:29 +0000
commitcd28058f07fda57f6569316723f776f1b9b80e50 (patch)
treeac5133ecdb0c03c3b47885fd3fe8a2b590558316 /Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts
parent28aea0ced979675c19d78d9c38991580b20e931a (diff)
parent764c499add501af742b7098f4cc204feadbccda4 (diff)
downloadtimeline-cd28058f07fda57f6569316723f776f1b9b80e50.tar.gz
timeline-cd28058f07fda57f6569316723f776f1b9b80e50.tar.bz2
timeline-cd28058f07fda57f6569316723f776f1b9b80e50.zip
Merged PR 9: Add entrance animation of todo item.
Add entrance animation of todo item. Related work items: #5
Diffstat (limited to 'Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts')
-rw-r--r--Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts23
1 files changed, 20 insertions, 3 deletions
diff --git a/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts b/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts
index e58cca7d..b04d1300 100644
--- a/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts
+++ b/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts
@@ -1,19 +1,36 @@
import { Component, OnInit } from '@angular/core';
import { TodoListService, WorkItem } 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']
+ 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: WorkItem[];
+ items: WorkItem[] = [];
+ isLoadCompleted = false;
constructor(private todoService: TodoListService) {
}
ngOnInit() {
- this.todoService.getWorkItemList().subscribe(result => this.items = result);
+ this.todoService.getWorkItemList().subscribe({
+ next: result => this.items.push(result),
+ complete: () => { this.isLoadCompleted = true; }
+ });
}
}