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); } }