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}}