From 4ec7854562adde8a90653353de6e7b7be07bcb4d Mon Sep 17 00:00:00 2001 From: nikita Date: Tue, 12 Feb 2019 15:13:37 +0530 Subject: [PATCH] commit --- 400-SOURCECODE/AIAHTML5.Web/app/filters/AIAFilter.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/filters/AIAFilter.js b/400-SOURCECODE/AIAHTML5.Web/app/filters/AIAFilter.js index 9eff409..0629ed9 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/filters/AIAFilter.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/filters/AIAFilter.js @@ -1,10 +1,13 @@ -app.filter('startsWithLetter', function () { +AIA.filter('startsWithLetter', function () { return function (items, letter) { + var filtered = []; - var letterMatch = new RegExp(letter, 'i'); + var letterMatch = new RegExp("^" + letter._TermText, 'i'); for (var i = 0; i < items.length; i++) { var item = items[i]; - if (letterMatch.test(item.name.substring(0, 1))) { + //if (letterMatch.test(item._TermText.substring(0, 1))) { + if (letterMatch.test(item._TermText)) { + filtered.push(item); } } -- libgit2 0.21.4