From 8703c52392adeb84beb36a21b0b2362678036fcd Mon Sep 17 00:00:00 2001 From: DESKTOP-D5ILJ4S\flr_3 Date: Tue, 10 Jul 2018 11:29:06 +0700 Subject: [PATCH] แก้ เสริชแล้วลบ ข้อมูลหาย --- src/app/dashboard/filter.pipe.ts | 10 +++++----- src/app/dashboard/short.ts | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/dashboard/filter.pipe.ts b/src/app/dashboard/filter.pipe.ts index a2ff2b8..09ece2b 100644 --- a/src/app/dashboard/filter.pipe.ts +++ b/src/app/dashboard/filter.pipe.ts @@ -14,22 +14,22 @@ export class FilterPipe implements PipeTransform { const resultArray = []; for (const item of value) { console.log('item: ', item); + var st = ''; // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; if(item['team']){ - st = st + item['team'].toLowerCase(); + st += item['team'].toLowerCase(); } if(item['COMMENT']){ - st = st + item['COMMENT'].toLowerCase(); + st += item['COMMENT'].toLowerCase(); } if(item['custgroupName']){ - st = st + item['custgroupName'].toLowerCase(); + st += item['custgroupName'].toLowerCase(); } if(item['STATUS']){ - st = st + item['STATUS'].toLowerCase(); + st += item['STATUS'].toLowerCase(); } - var string2 = filterString.toLowerCase(); if (st.indexOf(string2) > -1) { resultArray.push(item); diff --git a/src/app/dashboard/short.ts b/src/app/dashboard/short.ts index c3606eb..0a8e460 100644 --- a/src/app/dashboard/short.ts +++ b/src/app/dashboard/short.ts @@ -5,6 +5,9 @@ import { PipeTransform, Pipe } from "@angular/core"; }) export class ShortPipe implements PipeTransform { transform(value: string): string { + if(value === null){ + value = ''; + } return value.substr(0, 25) + ' ...'; } } \ No newline at end of file -- libgit2 0.21.2