Skip to content

Commit

Permalink
Merge pull request spring-io#973 from swagger-api/fix-js-angular-regr
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma authored Oct 5, 2021
2 parents 99f0b37 + d716379 commit be8f9f2
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ public void processOpts() {
// Libraries generated with v2.x of ng-packagr will ship with AoT metadata in v4, which is intended for Angular v5 (and Angular v6).
additionalProperties.put("useOldNgPackagr", !ngVersion.atLeast("5.0.0"));

// set http client usage
if (ngVersion.atLeast("8.0.0")) {
additionalProperties.put("useHttpClient", true);
} else if (ngVersion.atLeast("4.3.0")) {
additionalProperties.put("useHttpClient", true);
} else {
additionalProperties.put("useHttpClient", false);
}

if (additionalProperties.containsKey(PROVIDED_IN_ROOT) && !ngVersion.atLeast("6.0.0")) {
additionalProperties.put(PROVIDED_IN_ROOT,false);
}
Expand Down Expand Up @@ -213,8 +222,6 @@ private void addNpmPackageGeneration(SemVer ngVersion) {
this.setNpmRepository(additionalProperties.get(NPM_REPOSITORY).toString());
}

additionalProperties.put("useRxJS6", true);
additionalProperties.put("useHttpClient", true);
additionalProperties.put("useHttpClientPackage", false);
if (ngVersion.atLeast("11.0.0")) {
additionalProperties.put("tsVersion", ">=4.0.0 <4.1.0");
Expand Down Expand Up @@ -263,7 +270,6 @@ private void addNpmPackageGeneration(SemVer ngVersion) {
additionalProperties.put("tsickleVersion", "0.32.1");
additionalProperties.put("zonejsVersion", "0.8.26");

additionalProperties.put("useRxJS6", false);
additionalProperties.put("useHttpClientPackage", true);
}

Expand Down

0 comments on commit be8f9f2

Please sign in to comment.