diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index debe4c15a54..aec16710925 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -12,7 +12,9 @@ import { Response, ResponseContentType } from '@angular/http {{/useHttpClient}} import { Observable } from 'rxjs/Observable'; +{{^useHttpClient}} import '../rxjs-operators'; +{{/useHttpClient}} {{#imports}} import { {{classname}} } from '../{{filename}}'; diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/rxjs-operators.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/rxjs-operators.mustache index 5659cd0694f..49e265860b6 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/rxjs-operators.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/rxjs-operators.mustache @@ -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}} \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/default/git_push.sh b/samples/client/petstore/typescript-angular-v2/default/git_push.sh index ed374619b13..ae01b182ae9 100644 --- a/samples/client/petstore/typescript-angular-v2/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v2/default/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git diff --git a/samples/client/petstore/typescript-angular-v2/default/rxjs-operators.ts b/samples/client/petstore/typescript-angular-v2/default/rxjs-operators.ts index 5659cd0694f..2e79f871519 100644 --- a/samples/client/petstore/typescript-angular-v2/default/rxjs-operators.ts +++ b/samples/client/petstore/typescript-angular-v2/default/rxjs-operators.ts @@ -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 diff --git a/samples/client/petstore/typescript-angular-v2/npm/git_push.sh b/samples/client/petstore/typescript-angular-v2/npm/git_push.sh index ed374619b13..ae01b182ae9 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/git_push.sh +++ b/samples/client/petstore/typescript-angular-v2/npm/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git diff --git a/samples/client/petstore/typescript-angular-v2/npm/rxjs-operators.ts b/samples/client/petstore/typescript-angular-v2/npm/rxjs-operators.ts index 5659cd0694f..2e79f871519 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/rxjs-operators.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/rxjs-operators.ts @@ -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 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/git_push.sh b/samples/client/petstore/typescript-angular-v2/with-interfaces/git_push.sh index ed374619b13..ae01b182ae9 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/git_push.sh +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/package.json b/samples/client/petstore/typescript-angular-v2/with-interfaces/package.json index d6aee04c589..0e363919a9b 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/package.json +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/package.json @@ -35,6 +35,6 @@ "typescript": "^2.1.5" }, "publishConfig": { - "registry":"https://skimdb.npmjs.com/registry" + "registry": "https://skimdb.npmjs.com/registry" } } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/rxjs-operators.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/rxjs-operators.ts index 5659cd0694f..2e79f871519 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/rxjs-operators.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/rxjs-operators.ts @@ -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 diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index e6dbfc38628..f5fcff36509 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -15,7 +15,6 @@ import { Inject, Injectable, Optional } from '@angular/core import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; -import '../rxjs-operators'; import { ApiResponse } from '../model/apiResponse'; import { Pet } from '../model/pet'; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index e381873818a..68d29bf9b87 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -15,7 +15,6 @@ import { Inject, Injectable, Optional } from '@angular/core import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; -import '../rxjs-operators'; import { Order } from '../model/order'; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index 55fb2bb500b..ba9d9c81562 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -15,7 +15,6 @@ import { Inject, Injectable, Optional } from '@angular/core import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; -import '../rxjs-operators'; import { User } from '../model/user'; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh b/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh index ed374619b13..ae01b182ae9 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh +++ b/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/rxjs-operators.ts b/samples/client/petstore/typescript-angular-v4.3/npm/rxjs-operators.ts index 5659cd0694f..ae0d4c491d7 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/rxjs-operators.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/rxjs-operators.ts @@ -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'; diff --git a/samples/client/petstore/typescript-angular-v4/npm/git_push.sh b/samples/client/petstore/typescript-angular-v4/npm/git_push.sh index ed374619b13..ae01b182ae9 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/git_push.sh +++ b/samples/client/petstore/typescript-angular-v4/npm/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git diff --git a/samples/client/petstore/typescript-angular-v4/npm/rxjs-operators.ts b/samples/client/petstore/typescript-angular-v4/npm/rxjs-operators.ts index 5659cd0694f..2e79f871519 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/rxjs-operators.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/rxjs-operators.ts @@ -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