Skip to content

Commit

Permalink
0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
VadimDez committed Jan 18, 2017
1 parent fc4c1dd commit 229201e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 0.1.5
* [[#15](https://github.com/VadimDez/ng2-filter-pipe/issues/15)] - Filter by object key which can be equals null

## 0.1.4
* [[#17](https://github.com/VadimDez/ng2-filter-pipe/issues/17)] - Can't filter by getter properties of classes

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng2-filter-pipe",
"version": "0.1.4",
"version": "0.1.5",
"author": "Vadym Yatsyuk <[email protected]>",
"license": "MIT",
"angular-cli": {},
Expand Down
8 changes: 5 additions & 3 deletions src/ng2-filter.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import { Pipe, Injectable } from '@angular/core';
export class Ng2FilterPipe {

private filterByString(filter) {
filter = filter ? filter.toLowerCase() : filter;
if (filter) {
filter = filter.toLowerCase();
}
return value => {
return !filter || value ? value.toLowerCase().indexOf(filter) !== -1 : false;
return !filter || (value ? value.toLowerCase().indexOf(filter) !== -1 : false);
}
}

Expand Down Expand Up @@ -105,4 +107,4 @@ export class Ng2FilterPipe {

return array.filter(this.filterDefault(filter));
}
}
}

0 comments on commit 229201e

Please sign in to comment.