angular - Assign Observable to do dynamic query in angularfire2 list -


is there way pass in entire query observable? method end calling query twice once startat , once endat. want search wildcard.

import { component, oninit } '@angular/core'; import { angularfire, firebaselistobservable } 'angularfire2'; import { subject } 'rxjs';  @component({   selector: 'app-search',   templateurl: './search.component.html',   styleurls: ['./search.component.css'] }) export class searchcomponent implements oninit {    private sources: firebaselistobservable<any>;   private uid: string;   private searchsubject: subject<searchsubject>;   private search: search;   constructor(private af: angularfire) {     this.search = new search("");     this.searchsubject = new subject<searchsubject>();     af.auth.subscribe(d => {       this.uid = d.uid;       this.sources = af.database.list('/sources', {         query: {           orderbychild: 'name',           startat: this.searchsubject.map(d=>{             return d.startat;           }),           endat: this.searchsubject.map(d=>{             return d.endat;           })         }       });       this.sources.subscribe(d=>{         console.log(d);       });     });   }   ngoninit() {   }   onsearch(form: any): void {     this.searchsubject.next(new searchsubject('name',this.search.value,this.search.value+"\uf8ff"));   } }  export class search {   constructor(     public value: string   ) {  } } export class searchsubject {   constructor(     public orderbychild:string,     public startat: string,     public endat: string   ) {  } } 


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -