File tree Expand file tree Collapse file tree 3 files changed +24
-8
lines changed
handlebars/typescript-angular
mustache/typescript-angular Expand file tree Collapse file tree 3 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,12 @@ _without publishing (not recommended):_
31
31
32
32
```
33
33
{ {#useNgPackagr} }
34
- npm install PATH_TO_GENERATED_PACKAGE/dist --save
34
+ npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save
35
35
{ {/useNgPackagr} }
36
36
{ {^useNgPackagr} }
37
- npm install PATH_TO_GENERATED_PACKAGE --save
37
+ npm install PATH_TO_GENERATED_PACKAGE/ { {npmName } }- { {npmVersion } }.tgz --save
38
38
{ {/useNgPackagr} }
39
- ```
39
+ It's important to take the tgz file, otherwise you'll get trouble with links on windows.
40
40
41
41
_using `npm link`:_
42
42
@@ -190,4 +190,4 @@ import { environment } from '../environments/environment';
190
190
bootstrap: [ AppComponent ]
191
191
})
192
192
export class AppModule { }
193
- ```
193
+ ```
Original file line number Diff line number Diff line change @@ -218,6 +218,14 @@ export class {{classname}} {
218
218
}
219
219
220
220
{ {/isBasic} }
221
+ { {#isBearer} }
222
+ if (this.configuration.accessToken) {
223
+ const accessToken = typeof this.configuration.accessToken === ' function'
224
+ ? this.configuration.accessToken()
225
+ : this.configuration.accessToken;
226
+ {{#useHttpClient} }headers = { {/useHttpClient} }headers.set('Authorization', 'Bearer ' + accessToken);
227
+ }
228
+ { {/isBearer} }
221
229
{ {#isOAuth} }
222
230
if (this.configuration.accessToken) {
223
231
const accessToken = typeof this.configuration.accessToken === ' function'
@@ -312,8 +320,8 @@ export class {{classname}} {
312
320
313
321
{ {/hasFormParams} }
314
322
{ {#useHttpClient} }
315
- return this.httpClient.{ {httpMethod} }{ {^isResponseFile} }<{ {#returnType} }{ {{returnType} }}{ {#isResponseTypeFile} }|undefined{ {/isResponseTypeFile} }{ {/returnType} }{ {^returnType} }any{ {/returnType} }>{ {/isResponseFile} }(`${ this.basePath} { {{path} }}`,{ {#isBodyAllowed } }
316
- { {#bodyParam} }{ {paramName} }{ {/bodyParam} }{ {^bodyParam} }{ {#hasFormParams} }convertFormParamsToString ? formParams.toString() : formParams{ {/hasFormParams} }{ {^hasFormParams} }null{ {/hasFormParams} }{ {/bodyParam} },{ {/isBodyAllowed } }
323
+ return this.httpClient.{ {httpMethod} }{ {^isResponseFile} }<{ {#returnType} }{ {{returnType} }}{ {#isResponseTypeFile} }|undefined{ {/isResponseTypeFile} }{ {/returnType} }{ {^returnType} }any{ {/returnType} }>{ {/isResponseFile} }(`${ this.basePath} { {{path} }}`,{ {#hasBodyParam } }
324
+ { {#bodyParam} }{ {paramName} }{ {/bodyParam} }{ {^bodyParam} }{ {#hasFormParams} }convertFormParamsToString ? formParams.toString() : formParams{ {/hasFormParams} }{ {^hasFormParams} }null{ {/hasFormParams} }{ {/bodyParam} },{ {/hasBodyParam } }
317
325
{
318
326
{{#hasQueryParams} }
319
327
params: queryParameters,
Original file line number Diff line number Diff line change @@ -218,6 +218,14 @@ export class {{classname}} {
218
218
}
219
219
220
220
{ {/isBasic} }
221
+ { {#isBearer} }
222
+ if (this.configuration.accessToken) {
223
+ const accessToken = typeof this.configuration.accessToken === ' function'
224
+ ? this.configuration.accessToken()
225
+ : this.configuration.accessToken;
226
+ {{#useHttpClient} }headers = { {/useHttpClient} }headers.set('Authorization', 'Bearer ' + accessToken);
227
+ }
228
+ { {/isBearer} }
221
229
{ {#isOAuth} }
222
230
if (this.configuration.accessToken) {
223
231
const accessToken = typeof this.configuration.accessToken === ' function'
@@ -312,8 +320,8 @@ export class {{classname}} {
312
320
313
321
{ {/hasFormParams} }
314
322
{ {#useHttpClient} }
315
- return this.httpClient.{ {httpMethod} }{ {^isResponseFile} }<{ {#returnType} }{ {{returnType} }}{ {#isResponseTypeFile} }|undefined{ {/isResponseTypeFile} }{ {/returnType} }{ {^returnType} }any{ {/returnType} }>{ {/isResponseFile} }(`${ this.basePath} { {{path} }}`,{ {#isBodyAllowed } }
316
- { {#bodyParam} }{ {paramName} }{ {/bodyParam} }{ {^bodyParam} }{ {#hasFormParams} }convertFormParamsToString ? formParams.toString() : formParams{ {/hasFormParams} }{ {^hasFormParams} }null{ {/hasFormParams} }{ {/bodyParam} },{ {/isBodyAllowed } }
323
+ return this.httpClient.{ {httpMethod} }{ {^isResponseFile} }<{ {#returnType} }{ {{returnType} }}{ {#isResponseTypeFile} }|undefined{ {/isResponseTypeFile} }{ {/returnType} }{ {^returnType} }any{ {/returnType} }>{ {/isResponseFile} }(`${ this.basePath} { {{path} }}`,{ {#hasBodyParam } }
324
+ { {#bodyParam} }{ {paramName} }{ {/bodyParam} }{ {^bodyParam} }{ {#hasFormParams} }convertFormParamsToString ? formParams.toString() : formParams{ {/hasFormParams} }{ {^hasFormParams} }null{ {/hasFormParams} }{ {/bodyParam} },{ {/hasBodyParam } }
317
325
{
318
326
{{#hasQueryParams} }
319
327
params: queryParameters,
You can’t perform that action at this time.
0 commit comments