this is my error:
09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1396
Property or signature expected.
L1395: post<T>(url: string, body: any | null, options: {
L1396: data => {
L1397: headers?: HttpHeaders;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1396
’,’ expected.
L1395: post<T>(url: string, body: any | null, options: {
L1396: data => {
L1397: headers?: HttpHeaders;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1397
’,’ expected.
L1396: data => {
L1397: headers?: HttpHeaders;
L1398: observe: 'response';
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1397
Property destructuring pattern expected.
L1396: data => {
L1397: headers?: HttpHeaders;
L1398: observe: 'response';
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1397
’,’ expected.
L1396: data => {
L1397: headers?: HttpHeaders;
L1398: observe: 'response';
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1398
Identifier expected.
L1397: headers?: HttpHeaders;
L1398: observe: 'response';
L1399: params?: HttpParams;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1398
’,’ expected.
L1397: headers?: HttpHeaders;
L1398: observe: 'response';
L1399: params?: HttpParams;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1399
’,’ expected.
L1398: observe: 'response';
L1399: params?: HttpParams;
L1400: reportProgress?: boolean;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1399
Property destructuring pattern expected.
L1398: observe: 'response';
L1399: params?: HttpParams;
L1400: reportProgress?: boolean;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1399
’,’ expected.
L1398: observe: 'response';
L1399: params?: HttpParams;
L1400: reportProgress?: boolean;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1400
’,’ expected.
L1399: params?: HttpParams;
L1400: reportProgress?: boolean;
L1401: responseType?: 'json';
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1400
Property destructuring pattern expected.
L1399: params?: HttpParams;
L1400: reportProgress?: boolean;
L1401: responseType?: 'json';
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1400
’,’ expected.
L1399: params?: HttpParams;
L1400: reportProgress?: boolean;
L1401: responseType?: 'json';
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1401
’,’ expected.
L1400: reportProgress?: boolean;
L1401: responseType?: 'json';
L1402: withCredentials?: boolean;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1401
Property destructuring pattern expected.
L1400: reportProgress?: boolean;
L1401: responseType?: 'json';
L1402: withCredentials?: boolean;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1401
’:’ expected.
L1400: reportProgress?: boolean;
L1401: responseType?: 'json';
L1402: withCredentials?: boolean;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1402
’,’ expected.
L1401: responseType?: 'json';
L1402: withCredentials?: boolean;
L1403: }): Observable<HttpResponse<T>>;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1402
Property destructuring pattern expected.
L1401: responseType?: 'json';
L1402: withCredentials?: boolean;
L1403: }): Observable<HttpResponse<T>>;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1402
’,’ expected.
L1401: responseType?: 'json';
L1402: withCredentials?: boolean;
L1403: }): Observable<HttpResponse<T>>;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1398
Duplicate identifier ‘(Missing)’.
L1397: headers?: HttpHeaders;
L1398: observe: 'response';
L1399: params?: HttpParams;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1398
A parameter initializer is only allowed in a function or constructor implementation.
L1397: headers?: HttpHeaders;
L1398: observe: 'response';
L1399: params?: HttpParams;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1400
Duplicate identifier ‘boolean’.
L1399: params?: HttpParams;
L1400: reportProgress?: boolean;
L1401: responseType?: 'json';
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1401
Duplicate identifier ‘(Missing)’.
L1400: reportProgress?: boolean;
L1401: responseType?: 'json';
L1402: withCredentials?: boolean;
[09:15:27] typescript: node_modules/@angular/common/http/src/client.d.ts, line: 1402
Duplicate identifier ‘boolean’.
L1401: responseType?: 'json';
L1402: withCredentials?: boolean;
L1403: }): Observable<HttpResponse<T>>;
IMPORTS:
HttpClientModule,
JwtModule.forRoot({
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [Storage]
}
}),
export function jwtOptionsFactory(storage: Storage) {
return {
tokenGetter: () => {
return storage.get(‘id_token’);
}
}
}
An example in the service:
return new Promise(resolve => {
var headers = new HttpHeaders();
headers.append('Content-Type', 'application/json')
var options = { headers: headers, withCredentials: true };
let params = {
'uid' : deviceId
}
this.authHttp.post(URL_USER_CREATE_TOKEN, params, options)
// .map(res => res.json())
// .pipe(
// map(data => {
// console.log("create custom data", data)
// this.storage.set('id_token', data)
// resolve(data);
// })
// // catchError(error => {
// // console.log(error)
// // })
// )
.subscribe((data: any) => {
console.log("create custom data", data)
this.storage.set('id_token', data)
resolve(data);
}, (err: HttpErrorResponse) => {
console.log("failure creating user custom token: " + err);
}
);
});