1

Did anyone implement Tea Leaf analytics for an Angular 6 version application?

I am creating a cookie at node server (app.js) and then expecting to have cookie available with each API service call from the Angular application. Cookie needs to be visible in the HTTP request headers of each API call made from Angular application.

Can you please let me know if we can clone the HTTP response headers to have cookie persisted with each API service call from Angular application?

Here service API resides on IBM Web sphere. Tried placing withCredentials: true by cloning the HTTP request headers in TestInterceptor file.

/* Interceptor code goes here...*/
@Injectable()

export class TestInterceptor implements HttpInterceptor {
  intercept(req: HttpRequest < any > ,
    next: HttpHandler): Observable < HttpEvent < any >>
  {    
    req = req.clone({
      headers: req.headers.set('Accept', 'application/json'),
      withCredentials: true
    });

    return next.handle(req).pipe(catchError(error => {
      return throwError(error);
    }));
  }
}
crazy287
  • 41
  • 2
  • 7

0 Answers0