diff options
author | 杨宇千 <crupest@outlook.com> | 2019-02-24 17:04:29 +0000 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-02-24 17:04:29 +0000 |
commit | 472cfcb7281cf8ee9dd3f22639c1370f99f7db16 (patch) | |
tree | 545c805dbd163da10845dfc352a4b3fe8e5ec01b /Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts | |
parent | 5e3896fee6b0d376cb7c3f1927596a8ed00e40e4 (diff) | |
parent | ad16dbe268984d639c4924fb8bb1e69e68c0fef7 (diff) | |
download | timeline-472cfcb7281cf8ee9dd3f22639c1370f99f7db16.tar.gz timeline-472cfcb7281cf8ee9dd3f22639c1370f99f7db16.tar.bz2 timeline-472cfcb7281cf8ee9dd3f22639c1370f99f7db16.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.ts | 23 |
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; } + }); } } |