@@ -160,6 +160,15 @@ public void processOpts() {
160
160
// Libraries generated with v2.x of ng-packagr will ship with AoT metadata in v4, which is intended for Angular v5 (and Angular v6).
161
161
additionalProperties .put ("useOldNgPackagr" , !ngVersion .atLeast ("5.0.0" ));
162
162
163
+ // set http client usage
164
+ if (ngVersion .atLeast ("8.0.0" )) {
165
+ additionalProperties .put ("useHttpClient" , true );
166
+ } else if (ngVersion .atLeast ("4.3.0" )) {
167
+ additionalProperties .put ("useHttpClient" , true );
168
+ } else {
169
+ additionalProperties .put ("useHttpClient" , false );
170
+ }
171
+
163
172
if (additionalProperties .containsKey (PROVIDED_IN_ROOT ) && !ngVersion .atLeast ("6.0.0" )) {
164
173
additionalProperties .put (PROVIDED_IN_ROOT ,false );
165
174
}
@@ -213,8 +222,6 @@ private void addNpmPackageGeneration(SemVer ngVersion) {
213
222
this .setNpmRepository (additionalProperties .get (NPM_REPOSITORY ).toString ());
214
223
}
215
224
216
- additionalProperties .put ("useRxJS6" , true );
217
- additionalProperties .put ("useHttpClient" , true );
218
225
additionalProperties .put ("useHttpClientPackage" , false );
219
226
if (ngVersion .atLeast ("11.0.0" )) {
220
227
additionalProperties .put ("tsVersion" , ">=4.0.0 <4.1.0" );
@@ -263,7 +270,6 @@ private void addNpmPackageGeneration(SemVer ngVersion) {
263
270
additionalProperties .put ("tsickleVersion" , "0.32.1" );
264
271
additionalProperties .put ("zonejsVersion" , "0.8.26" );
265
272
266
- additionalProperties .put ("useRxJS6" , false );
267
273
additionalProperties .put ("useHttpClientPackage" , true );
268
274
}
269
275
0 commit comments