Skip to content

Commit 50cb17f

Browse files
committed
Filter for angular is case sensative and sholud not be
1 parent 976cc00 commit 50cb17f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/filters/filter-directive.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@
9393
9494
var matchesFilter = function (item, filter) {
9595
var match = true;
96+
var re = new RegExp(filter.value, 'i');
9697
9798
if (filter.id === 'name') {
98-
match = item.name.match(filter.value) !== null;
99+
match = item.name.match(re) !== null;
99100
} else if (filter.id === 'address') {
100-
match = item.address.match(filter.value) !== null;
101+
match = item.address.match(re) !== null;
101102
} else if (filter.id === 'birthMonth') {
102103
match = item.birthMonth === filter.value;
103104
}

src/toolbars/toolbar-directive.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,14 @@
171171
172172
var matchesFilter = function (item, filter) {
173173
var match = true;
174+
var re = new RegExp(filter.value, 'i');
174175
175176
if (filter.id === 'name') {
176-
match = item.name.match(filter.value) !== null;
177+
match = item.name.match(re) !== null;
177178
} else if (filter.id === 'age') {
178179
match = item.age === parseInt(filter.value);
179180
} else if (filter.id === 'address') {
180-
match = item.address.match(filter.value) !== null;
181+
match = item.address.match(re) !== null;
181182
} else if (filter.id === 'birthMonth') {
182183
match = item.birthMonth === filter.value;
183184
}

0 commit comments

Comments
 (0)