Skip to content

Commit 69dceb3

Browse files
dabengjeff-phillips-18
authored andcommitted
Filter for angular is case sensative and sholud not be
1 parent 14bd794 commit 69dceb3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/filters/examples/filter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,12 @@
9494
9595
var matchesFilter = function (item, filter) {
9696
var match = true;
97+
var re = new RegExp(filter.value, 'i');
9798
9899
if (filter.id === 'name') {
99-
match = item.name.match(filter.value) !== null;
100+
match = item.name.match(re) !== null;
100101
} else if (filter.id === 'address') {
101-
match = item.address.match(filter.value) !== null;
102+
match = item.address.match(re) !== null;
102103
} else if (filter.id === 'birthMonth') {
103104
match = item.birthMonth === filter.value;
104105
}

src/toolbars/examples/toolbar.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,14 @@
234234
235235
var matchesFilter = function (item, filter) {
236236
var match = true;
237+
var re = new RegExp(filter.value, 'i');
237238
238239
if (filter.id === 'name') {
239-
match = item.name.match(filter.value) !== null;
240+
match = item.name.match(re) !== null;
240241
} else if (filter.id === 'age') {
241242
match = item.age === parseInt(filter.value);
242243
} else if (filter.id === 'address') {
243-
match = item.address.match(filter.value) !== null;
244+
match = item.address.match(re) !== null;
244245
} else if (filter.id === 'birthMonth') {
245246
match = item.birthMonth === filter.value;
246247
}

0 commit comments

Comments
 (0)