This code is in angular 13 what is the equivalent in angular 9

The following code is in angular 13 and i need it to work in angular 9 but “HttpContext, HttpContextToken” aren’t available does anyone know how to do in angular 9 ?

`import {InjectionToken} from “@angular/core”;
import {Observable} from “rxjs”;
impor…


This content originally appeared on DEV Community and was authored by rorykilpatrick

The following code is in angular 13 and i need it to work in angular 9 but "HttpContext, HttpContextToken" aren't available does anyone know how to do in angular 9 ?

`import {InjectionToken} from "@angular/core";
import {Observable} from "rxjs";
import {AuthConfig} from "angular-oauth2-oidc";
import {HttpContext, HttpContextToken} from '@angular/common/http';

export enum JWTHeaderEnum {
NONE,
JWT,
AUTHORIZATION,
}

export const AUTH_TOKEN_HEADER = new HttpContextToken(() => JWTHeaderEnum.JWT);

export const HTTPCONTEXT_KONG_ENDPOINT = new HttpContext().set(AUTH_TOKEN_HEADER, JWTHeaderEnum.AUTHORIZATION);
export const HTTPCONTEXT_APIGEE_ENDPOINT = new HttpContext().set(AUTH_TOKEN_HEADER, JWTHeaderEnum.JWT);
export const HTTPCONTEXT_NO_AUTH = new HttpContext().set(AUTH_TOKEN_HEADER, JWTHeaderEnum.NONE);
`


This content originally appeared on DEV Community and was authored by rorykilpatrick


Print Share Comment Cite Upload Translate Updates
APA

rorykilpatrick | Sciencx (2024-10-07T01:04:48+00:00) This code is in angular 13 what is the equivalent in angular 9. Retrieved from https://www.scien.cx/2024/10/07/this-code-is-in-angular-13-what-is-the-equivalent-in-angular-9/

MLA
" » This code is in angular 13 what is the equivalent in angular 9." rorykilpatrick | Sciencx - Monday October 7, 2024, https://www.scien.cx/2024/10/07/this-code-is-in-angular-13-what-is-the-equivalent-in-angular-9/
HARVARD
rorykilpatrick | Sciencx Monday October 7, 2024 » This code is in angular 13 what is the equivalent in angular 9., viewed ,<https://www.scien.cx/2024/10/07/this-code-is-in-angular-13-what-is-the-equivalent-in-angular-9/>
VANCOUVER
rorykilpatrick | Sciencx - » This code is in angular 13 what is the equivalent in angular 9. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/07/this-code-is-in-angular-13-what-is-the-equivalent-in-angular-9/
CHICAGO
" » This code is in angular 13 what is the equivalent in angular 9." rorykilpatrick | Sciencx - Accessed . https://www.scien.cx/2024/10/07/this-code-is-in-angular-13-what-is-the-equivalent-in-angular-9/
IEEE
" » This code is in angular 13 what is the equivalent in angular 9." rorykilpatrick | Sciencx [Online]. Available: https://www.scien.cx/2024/10/07/this-code-is-in-angular-13-what-is-the-equivalent-in-angular-9/. [Accessed: ]
rf:citation
» This code is in angular 13 what is the equivalent in angular 9 | rorykilpatrick | Sciencx | https://www.scien.cx/2024/10/07/this-code-is-in-angular-13-what-is-the-equivalent-in-angular-9/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.