The code is below
import {Component} from \'angular2/core\';
import {Observable} from \'rxjs/Rx\';
@Component({
selector: \'my-app\',
template: \'Ticks (every s
Thats because you havent patched the timer
method into the Observable
prototype.
Update: Rxjs 6.0.0
Import the creation method as a static pure function:
import { timer } from 'rxjs';
let timer$ = timer(2000,1000);
Original answer:
You have 2 options:
1) Patch the method with:
import 'rxjs/add/observable/timer';
2) Import the operator as a static pure function:
import { timer } from 'rxjs/observable/timer';
let timer$ = timer(2000,1000);
Personally I would recommend the 2nd approach.