ngx-filter-pipe icon indicating copy to clipboard operation
ngx-filter-pipe copied to clipboard

How to return Nested null objects

Open khkassem opened this issue 4 years ago • 0 comments

Bug Report or Feature Request (mark with an x)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [ ] Bug report -> please search issues before submitting
- [* ] Feature request
- [ ] Documentation issue or request

Hello,

This is related to #67,

import { Component } from '@angular/core';

import { FilterPipe } from 'ngx-filter-pipe';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  issues: any[] = [{ title: 'issue1', user: {name: 'user1', email: '[email protected]' }}, { title: 'issue2' ,user:null}];
  userFilter: any = {user:{email: '[email protected]' }};

  constructor(private filterPipe: FilterPipe) {
    console.log(filterPipe.transform(this.issues, this.userFilter));
  }
}

Is there a way to modify userFilter so it return elements with user=null, in addition to users with the specified email?

I tried adding {user:null} with an $or key without success.

Thank you

khkassem avatar Mar 24 '20 09:03 khkassem