mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
835987b78b
Instead of the deprecated tslint use eslint in the aio's example-lint script PR Close #43218
25 lines
531 B
TypeScript
25 lines
531 B
TypeScript
// #docplaster
|
|
/*
|
|
Because of how the code is merged together using the doc regions,
|
|
we need to indent the imports with the function below.
|
|
*/
|
|
// #docregion
|
|
import { of } from 'rxjs';
|
|
import { filter, map } from 'rxjs/operators';
|
|
|
|
// #enddocregion
|
|
|
|
export function docRegionDefault(console: Console) {
|
|
// #docregion
|
|
const squareOdd = of(1, 2, 3, 4, 5)
|
|
.pipe(
|
|
filter(n => n % 2 !== 0),
|
|
map(n => n * n)
|
|
);
|
|
|
|
// Subscribe to get values
|
|
squareOdd.subscribe(x => console.log(x));
|
|
|
|
// #enddocregion
|
|
}
|