Remove rxjs operators (#6989)

* do not import rxjs-operators if using HttpClinet

* generate code

* do not import operators if they are not needed
This commit is contained in:
topce 2017-11-24 06:24:47 +01:00 committed by William Cheng
parent 57b42a544d
commit 8a0de971e4
10 changed files with 13 additions and 13 deletions

View File

@ -15,7 +15,9 @@ import { CustomQueryEncoderHelper } from '../encoder';
{{/useHttpClient}}
import { Observable } from 'rxjs/Observable';
{{^useHttpClient}}
import '../rxjs-operators';
{{/useHttpClient}}
{{#imports}}
import { {{classname}} } from '../{{filename}}';

View File

@ -1,3 +1,8 @@
{{#useHttpClient}}
// RxJS imports are not needed for Angular 4.3 and later
{{/useHttpClient}}
{{^useHttpClient}}
// RxJS imports according to https://angular.io/docs/ts/latest/guide/server-communication.html#!#rxjs
// See node_module/rxjs/Rxjs.js
@ -9,3 +14,4 @@ import 'rxjs/add/observable/throw';
// Operators
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
{{/useHttpClient}}

View File

@ -1,3 +1,4 @@
// RxJS imports according to https://angular.io/docs/ts/latest/guide/server-communication.html#!#rxjs
// See node_module/rxjs/Rxjs.js

View File

@ -1,3 +1,4 @@
// RxJS imports according to https://angular.io/docs/ts/latest/guide/server-communication.html#!#rxjs
// See node_module/rxjs/Rxjs.js

View File

@ -1,3 +1,4 @@
// RxJS imports according to https://angular.io/docs/ts/latest/guide/server-communication.html#!#rxjs
// See node_module/rxjs/Rxjs.js

View File

@ -17,7 +17,6 @@ import { HttpClient, HttpHeaders, HttpParams,
import { CustomHttpUrlEncodingCodec } from '../encoder';
import { Observable } from 'rxjs/Observable';
import '../rxjs-operators';
import { ApiResponse } from '../model/apiResponse';
import { Pet } from '../model/pet';

View File

@ -17,7 +17,6 @@ import { HttpClient, HttpHeaders, HttpParams,
import { CustomHttpUrlEncodingCodec } from '../encoder';
import { Observable } from 'rxjs/Observable';
import '../rxjs-operators';
import { Order } from '../model/order';

View File

@ -17,7 +17,6 @@ import { HttpClient, HttpHeaders, HttpParams,
import { CustomHttpUrlEncodingCodec } from '../encoder';
import { Observable } from 'rxjs/Observable';
import '../rxjs-operators';
import { User } from '../model/user';

View File

@ -1,11 +1,2 @@
// RxJS imports according to https://angular.io/docs/ts/latest/guide/server-communication.html#!#rxjs
// RxJS imports are not needed for Angular 4.3 and later
// See node_module/rxjs/Rxjs.js
// Import just the rxjs statics and operators we need for THIS app.
// Statics
import 'rxjs/add/observable/throw';
// Operators
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';

View File

@ -1,3 +1,4 @@
// RxJS imports according to https://angular.io/docs/ts/latest/guide/server-communication.html#!#rxjs
// See node_module/rxjs/Rxjs.js