import { Injectable } from '@angular/core' ; import { HttpEvent , HttpHandler , HttpInterceptor , HttpRequest } from '@angular/common/http' ; import { Observable } from 'rxjs' ; @ Injectable ( ) export class JwtTokenInterceptor implements HttpInterceptor { constructor ( ) { } intercept ( req , next ) { const jwtToken = localStorage . getItem ( 'jwt_token' ) || '' ; return next . handle ( req . clone ( { setHeaders : { 'Jwt-Token' : jwtToken } } ) ) ; } }