Looking to include and utilize the function below for debugging purposes:
export function debug(string) {
if(debugMode) { console.log(`DEBUG: ${string}`) }
}
However, I am unsure how to create a globally accessible variable like debugMode
. Can this be achieved with TypeScript? My plan is to define it in the app.component.ts
file as either true
or false
, ensuring that the function only runs when necessary.