according to this answer How to return an empty observable in rxjs , I tried all this, but it did not work for me
here is my code
post(url):Observalbe<any>{ if(this.holder.nullConnection()){ //checking internet connection //return empty observalbe return Observable.empty() ; }else{ return this.http.post(this.configurator.restServerBaseUrl+url,data) .map((result:Response)=> { return result.json() }) } }
I tried almost all the answers according to the stack question, which you can see above any help to return empty information.
source share