Skip to content

Commit 9014a3e

Browse files
resistancecanyonvmasek
authored andcommitted
feat(api-client) HttpOptions usage of reportProgress & withCredentials
* Fixes #45 reportProgress & withCredentials are set from constructor now if available. * automated tests for #45
1 parent 0899b92 commit 9014a3e

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

templates/ngx-service.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export class APIClient {
3131

3232
this.options = {
3333
headers: options && options.headers ? options.headers : new HttpHeaders(),
34-
params: options && options.params ? options.params : new HttpParams()
34+
params: options && options.params ? options.params : new HttpParams(),
35+
...(options && options.reportProgress ? { reportProgress: options.reportProgress } : {}),
36+
...(options && options.withCredentials ? { withCredentials: options.withCredentials } : {})
3537
};
3638
}
3739

tests/esquare/api/api-client.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export class APIClient {
2929

3030
this.options = {
3131
headers: options && options.headers ? options.headers : new HttpHeaders(),
32-
params: options && options.params ? options.params : new HttpParams()
32+
params: options && options.params ? options.params : new HttpParams(),
33+
...(options && options.reportProgress ? { reportProgress: options.reportProgress } : {}),
34+
...(options && options.withCredentials ? { withCredentials: options.withCredentials } : {})
3335
};
3436
}
3537

tests/gcloud-firestore/api/api-client.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export class APIClient {
2929

3030
this.options = {
3131
headers: options && options.headers ? options.headers : new HttpHeaders(),
32-
params: options && options.params ? options.params : new HttpParams()
32+
params: options && options.params ? options.params : new HttpParams(),
33+
...(options && options.reportProgress ? { reportProgress: options.reportProgress } : {}),
34+
...(options && options.withCredentials ? { withCredentials: options.withCredentials } : {})
3335
};
3436
}
3537

tests/github/api/api-client.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export class APIClient {
2929

3030
this.options = {
3131
headers: options && options.headers ? options.headers : new HttpHeaders(),
32-
params: options && options.params ? options.params : new HttpParams()
32+
params: options && options.params ? options.params : new HttpParams(),
33+
...(options && options.reportProgress ? { reportProgress: options.reportProgress } : {}),
34+
...(options && options.withCredentials ? { withCredentials: options.withCredentials } : {})
3335
};
3436
}
3537

0 commit comments

Comments
 (0)