Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit aa6f503

Browse files
authored
docs: remove rxjs-extensions in favor of explict imports (#3075)
Triggered by #2620 which it closes.
1 parent 0d5877d commit aa6f503

26 files changed

+180
-210
lines changed

public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// #docregion
22
import { Pipe, PipeTransform } from '@angular/core';
33
import { Http } from '@angular/http';
4-
import './rxjs-extensions';
4+
5+
import 'rxjs/add/operator/map';
56

67
// #docregion pipe-metadata
78
@Pipe({

public/docs/_examples/pipes/ts/app/hero-async-message.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// #docregion
22
import { Component } from '@angular/core';
3+
34
import { Observable } from 'rxjs/Observable';
4-
import './rxjs-extensions';
5+
import 'rxjs/add/observable/interval';
6+
import 'rxjs/add/operator/map';
7+
import 'rxjs/add/operator/take';
58

69
@Component({
710
selector: 'hero-message',

public/docs/_examples/pipes/ts/app/rxjs-extensions.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
// #docplaster
21
// #docregion
32
import { Component } from '@angular/core';
43

5-
// #docregion import-rxjs
6-
// Add the RxJS Observable operators.
7-
import './rxjs-operators';
8-
// #enddocregion import-rxjs
9-
104
@Component({
115
selector: 'my-app',
126
template: `
@@ -17,4 +11,3 @@ import './rxjs-operators';
1711
`
1812
})
1913
export class AppComponent { }
20-
// #enddocregion

public/docs/_examples/server-communication/ts/app/app.module.1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// #docregion
2-
import { NgModule } from '@angular/core';
2+
import { NgModule } from '@angular/core';
33
import { BrowserModule } from '@angular/platform-browser';
4-
import { FormsModule } from '@angular/forms';
4+
import { FormsModule } from '@angular/forms';
55
import { HttpModule, JsonpModule } from '@angular/http';
66

77
import { AppComponent } from './app.component';

public/docs/_examples/server-communication/ts/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// #docplaster
22
// #docregion
3-
import { NgModule } from '@angular/core';
3+
import { NgModule } from '@angular/core';
44
import { BrowserModule } from '@angular/platform-browser';
5-
import { FormsModule } from '@angular/forms';
5+
import { FormsModule } from '@angular/forms';
66
import { HttpModule, JsonpModule } from '@angular/http';
77

88

public/docs/_examples/server-communication/ts/app/rxjs-operators.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

public/docs/_examples/server-communication/ts/app/toh/hero.service.promise.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
// #docplaster
22
// #docregion
33
// Promise Version
4-
import { Injectable } from '@angular/core';
5-
import { Http, Response } from '@angular/http';
4+
import { Injectable } from '@angular/core';
5+
import { Http, Response } from '@angular/http';
66
import { Headers, RequestOptions } from '@angular/http';
7-
import { Hero } from './hero';
7+
8+
// #docregion rxjs-imports
9+
import 'rxjs/add/operator/toPromise';
10+
// #enddocregion rxjs-imports
11+
12+
import { Hero } from './hero';
813

914
@Injectable()
1015
export class HeroService {

public/docs/_examples/server-communication/ts/app/toh/hero.service.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22
// #docregion
33
// Observable Version
44
// #docregion v1
5-
import { Injectable } from '@angular/core';
6-
import { Http, Response } from '@angular/http';
5+
import { Injectable } from '@angular/core';
6+
import { Http, Response } from '@angular/http';
77
// #enddocregion v1
88
// #docregion import-request-options
99
import { Headers, RequestOptions } from '@angular/http';
1010
// #enddocregion import-request-options
1111
// #docregion v1
1212

13-
import { Hero } from './hero';
14-
import { Observable } from 'rxjs/Observable';
13+
// #docregion rxjs-imports
14+
import { Observable } from 'rxjs/Observable';
15+
import 'rxjs/add/operator/catch';
16+
import 'rxjs/add/operator/map';
17+
// #enddocregion rxjs-imports
18+
19+
import { Hero } from './hero';
1520

1621
@Injectable()
1722
export class HeroService {

public/docs/_examples/server-communication/ts/app/wiki/wiki-smart.component.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
11
/* tslint:disable: member-ordering forin */
22
// #docplaster
33
// #docregion
4-
import { Component, OnInit } from '@angular/core';
5-
import { Observable } from 'rxjs/Observable';
4+
import { Component, OnInit } from '@angular/core';
5+
6+
// #docregion rxjs-imports
7+
import { Observable } from 'rxjs/Observable';
8+
import 'rxjs/add/operator/debounceTime';
9+
import 'rxjs/add/operator/distinctUntilChanged';
10+
import 'rxjs/add/operator/switchMap';
11+
612
// #docregion import-subject
7-
import { Subject } from 'rxjs/Subject';
13+
import { Subject } from 'rxjs/Subject';
814
// #enddocregion import-subject
915

1016
import { WikipediaService } from './wikipedia.service';
1117

1218
@Component({
1319
moduleId: module.id,
1420
selector: 'my-wiki-smart',
15-
templateUrl: './wiki.component.html',
21+
template: `
22+
<h1>Smarter Wikipedia Demo</h1>
23+
<p>Search when typing stops</p>
24+
<input #term (keyup)="search(term.value)"/>
25+
<ul>
26+
<li *ngFor="let item of items | async">{{item}}</li>
27+
</ul>`,
1628
providers: [ WikipediaService ]
1729
})
1830
export class WikiSmartComponent implements OnInit {
19-
title = 'Smarter Wikipedia Demo';
20-
fetches = 'Fetches when typing stops';
2131
items: Observable<string[]>;
2232

33+
constructor (private wikipediaService: WikipediaService) {}
34+
2335
// #docregion subject
2436
private searchTermStream = new Subject<string>();
2537
search(term: string) { this.searchTermStream.next(term); }
2638
// #enddocregion subject
2739

28-
constructor (private wikipediaService: WikipediaService) {}
29-
3040
ngOnInit() {
3141
// #docregion observable-operators
3242
this.items = this.searchTermStream

0 commit comments

Comments
 (0)