How can I raise a compiler time error in angular so the compiler will not proceed and give me error depending on the values inside my enviroments.ts file. For instance consider the following scenario in which the application should use either authentication method 1 or 2 but not both :
environment.ts has the following content:
export const environment = {
production: false,
enableAuthenticationMethod1: true,
enableAuthenticationMethod2: false
};
while environment.prod.ts has the following content:
export const environment = {
production: true,
enableAuthenticationMethod1: false,
enableAuthenticationMethod2: true
};
Now in prod mode we have AuthenticationMethod1 disabled and AuthenticationMethod2 enabled. How can I make sure a compile time error for an environment file with the following (wrong) content will be raised:
export const environment = {
production: true,
enableAuthenticationMethod1: true,
enableAuthenticationMethod2: true
};