This is awesome! Thank you! Am Do., 13. Dez. 2018 um 08:17 Uhr schrieb Sander Elias < [email protected]>:
> Hi Jb, > > I usually take care of filtering outside of my tables. I created a small > sample > <https://github.com/SanderElias/Samples/blob/master/src/app/filter-samp/filter-sample/filter-sample.component.ts> > for you. You can check out the repo and play with it. > The gist of it is this: > > nameFilter = new FormControl(''); > > filter$ = this.nameFilter.valueChanges.pipe( > debounceTime(500), > distinctUntilChanged(), > startWith(''), > map((name: string) => name.trim().toLocaleLowerCase()) > ); > > users$ = this.us.userCards$; > > vm$ = combineLatest([this.users$, this.filter$]).pipe( > map(([users, filterStr]: Vm) => ({ > users: users.filter(row => > filterStr ? row.name.toLocaleLowerCase().includes(filterStr) : true > ) > })) > ); > > I'm using a ViewModel to get my updated data into the view. > Play with the sample, and if you have any questions don't hesitate to ask. > > Regards > Sander > > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Angular and AngularJS discussion" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/angular/7i9_3CIlWCA/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
