docs(Observable): add documentation for Observable and operators
Closes #5642 Closes #5684
This commit is contained in:
8
modules/angular2/examples/facade/ts/async/observable.ts
Normal file
8
modules/angular2/examples/facade/ts/async/observable.ts
Normal file
@ -0,0 +1,8 @@
|
||||
// #docregion Observable
|
||||
import {Observable} from 'angular2/core';
|
||||
var obs = new Observable<number>(obs => {
|
||||
var i = 0;
|
||||
setInterval(_ => { obs.next(++i); }, 1000);
|
||||
});
|
||||
obs.subscribe(i => console.log(`${i} seconds elapsed`));
|
||||
// #enddocregion
|
Reference in New Issue
Block a user