Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to filter by two variables of the same array #31

Closed
RicardoVaranda opened this issue Apr 21, 2017 · 0 comments
Closed

How to filter by two variables of the same array #31

RicardoVaranda opened this issue Apr 21, 2017 · 0 comments
Assignees
Milestone

Comments

@RicardoVaranda
Copy link

Hey guys,

In my use case I have the following object:

{
  "name": 'product 1';
  "version": '1';
  "software": null;
  "availability": ['Europe', 'America'];
  "language": ['English', 'German'];
}

I'm using objects with getters, binding as shown in the examples and returning the getter:

  constructor(data?: ProductInterface) {
    Object.assign(this, data);

    this.getName = this.getName.bind(this);
    this.getVersion = this.getVersion.bind(this);
    this.getLanguage = this.getLanguage.bind(this);
  }

  getLanguage() {
    return this.language;
  }

Currently to filter by one language I'd pass in the following filter:

{language: 'English'}

This works as intended, my issue is, I have a checkbox which allows the users to select multiple filters, how would I be able to pass both english and german into the language filter?

VadimDez added a commit that referenced this issue Apr 21, 2017
…rray is required for the match. For now check entire values.
@VadimDez VadimDez self-assigned this Apr 21, 2017
VadimDez added a commit that referenced this issue May 28, 2017
VadimDez added a commit that referenced this issue May 29, 2017
VadimDez added a commit that referenced this issue May 30, 2017
VadimDez added a commit that referenced this issue Jun 1, 2017
# Conflicts:
#	CHANGELOG.md
#	examples/ng-cli/src/app/shared/ng2-filter.pipe.spec.ts
#	package.json
#	src/ng2-filter.pipe.spec.ts
@VadimDez VadimDez mentioned this issue Jun 1, 2017
VadimDez added a commit that referenced this issue Jun 1, 2017
@VadimDez VadimDez added this to the 0.1.10 milestone Jun 1, 2017
@VadimDez VadimDez closed this as completed Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants