0

I want to use httpservice after a time delay. tried using

`import 'rxjs/add/operator/delay';`

however when I use delay in service;

this.httpService.put("http:addr?Id="+this.orgID, this.QRCodeImage).pipe(delay(3000)).subscribe(data => { console.log(data); });

'delay' is not getting recognized. however when I skip pipe and use delay, it gets recognized and throws error in console. How to delay sending an httpservice request.

Thanks :)

vsg
  • 175
  • 2
  • 11
  • Which version of RxJs are you using? The imports in pipeable operators (rxjs 5.6 or greater) are something like: import { delay } from 'rxjs/operators'. The import statement you put seems for a version less than 5.6 (so pipe(...) will not work). – Llorenç Pujol Ferriol Nov 28 '18 at 14:35
  • I tried it however it didn't work. async/await worked! check: https://stackoverflow.com/questions/37764665/typescript-sleep – vsg Nov 29 '18 at 06:59

0 Answers0