Can not import the Observable package from the timer feature?

0

Look closely at this tutorial:

Importing RXJS Observable functions in Angular 5

I'm having trouble importing the timer resource, I've tried writing the path in many ways and I can not import it.

Notice how the header of my class is!

Itriedtoinstallotherversionsofrxjs

Ihad"rxjs": "5.1.0" , but then I tried the version "rxjs": "^5.5.5" and version "rxjs": "^6.2.2" , and to no avail.

I really need help

    
asked by anonymous 31.07.2018 / 11:49

1 answer

2

import 'rxjs / add / observable / timer';

const timer = Observable.timer(1, 1000);
    this.sub = timer.subscribe(
      t => console.log('passou 1 segundo));
    
31.07.2018 / 18:14