From ad16dbe268984d639c4924fb8bb1e69e68c0fef7 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 25 Feb 2019 00:40:27 +0800 Subject: Add entrance animation of todo item. --- .../ClientApp/src/app/todo-list-page/todo-list.service.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Timeline/ClientApp/src/app/todo-list-page/todo-list.service.ts') diff --git a/Timeline/ClientApp/src/app/todo-list-page/todo-list.service.ts b/Timeline/ClientApp/src/app/todo-list-page/todo-list.service.ts index af3617fe..bfeb3285 100644 --- a/Timeline/ClientApp/src/app/todo-list-page/todo-list.service.ts +++ b/Timeline/ClientApp/src/app/todo-list-page/todo-list.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { switchMap, concatMap, map, toArray } from 'rxjs/operators'; +import { Observable, from } from 'rxjs'; +import { switchMap, concatMap, map } from 'rxjs/operators'; export interface AzureDevOpsAccessInfo { username: string; @@ -60,7 +60,7 @@ export class TodoListService { .pipe(map(result => result.icon.url)); } - getWorkItemList(): Observable { + getWorkItemList(): Observable { return this.getAzureDevOpsAccessInfo().pipe( switchMap(accessInfo => { const baseUrl = `https://dev.azure.com/${accessInfo.organization}/${accessInfo.project}/`; @@ -77,7 +77,7 @@ export class TodoListService { { headers: headers } ) .pipe( - switchMap(result => result.workItems), + concatMap(result => from(result.workItems)), concatMap(result => this.client.get(result.url, { headers: headers })), concatMap(result => this.getItemIconUrl(baseUrl, headers, result.fields[TodoListService.typeFieldName]).pipe( @@ -94,8 +94,7 @@ export class TodoListService { } ) ) - ), - toArray() + ) ); }) ); -- cgit v1.2.3