linq2js / linq2fire

Supports special operators: IN, NOT IN, OR, !=, startsWith (^=), array-contains (has) and many more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can I use linq2fire in auto-complete search ?

opened this issue · comments

can I use linq2fire in auto-complete search ?

HTML5

<input  type="text">

TS

const self = this;
self.results = self.afs.collection(`AddListData`, ref => ref
      .orderBy('title')
      .startAt(self.searchValue.toLowerCase())
      .endAt(self.searchValue.toLowerCase() + '\uf8ff')
      .limit(10))
      .valueChanges();

yes, you can
just refactor your code to:

const results = linq2fire(self.afs.collection(`AddListData`)).where({ 'title^=': searchValue }).limit(10).orderBy({ title: 'asc' })