Let's consider a scenario where we have a class named Constant.
The requirement is to make this class accessible globally without the need for importing, is there a way to achieve this?
In the constant.ts file:
class Constant {
public static get TOTAL_FOOD() : number {return 123;}
}
In the chicken.ts file:
class Chicken {
constructor() {
// I want to access Constant without explicitly importing it like "import {Constant}"
let totalFood : number = Constant.TOTAL_FOOD;
}
}