forked from loafle/openapi-generator-original
Update TypeScript to do a better check for empty on basePath.
In Angular if a value is not defined for injection it is passed as undefined. That means that most of the time `if (value) {` is a reasonable test. Unfortunately since `""` (empty string) is also falsey by nature, an empty string will not trigger the if properly. Instead you should check `if (value !== undefined) {`.
This commit is contained in:
parent
e17710fc72
commit
0b8c936972
@ -18,7 +18,7 @@ namespace {{package}} {
|
||||
static $inject: string[] = ['$http', '$httpParamSerializer'];
|
||||
|
||||
constructor(protected $http: ng.IHttpService, protected $httpParamSerializer?: (d: any) => any, basePath?: string) {
|
||||
if (basePath) {
|
||||
if (basePath !== undefined) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace API.Client {
|
||||
static $inject: string[] = ['$http', '$httpParamSerializer'];
|
||||
|
||||
constructor(protected $http: ng.IHttpService, protected $httpParamSerializer?: (d: any) => any, basePath?: string) {
|
||||
if (basePath) {
|
||||
if (basePath !== undefined) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace API.Client {
|
||||
static $inject: string[] = ['$http', '$httpParamSerializer'];
|
||||
|
||||
constructor(protected $http: ng.IHttpService, protected $httpParamSerializer?: (d: any) => any, basePath?: string) {
|
||||
if (basePath) {
|
||||
if (basePath !== undefined) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace API.Client {
|
||||
static $inject: string[] = ['$http', '$httpParamSerializer'];
|
||||
|
||||
constructor(protected $http: ng.IHttpService, protected $httpParamSerializer?: (d: any) => any, basePath?: string) {
|
||||
if (basePath) {
|
||||
if (basePath !== undefined) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user