I'm encountering an issue with a Typescript Class that I'm attempting to use. Even after instantiating it, I'm not getting the correct class instance.
Class GamesService
export interface IGame {
name: string;
online: number;
likes: number;
playedCount: number;
images: {
small: string;
medium: string;
large: string;
}
}
export class GamesService {
public getGames(): IGame[] {
return []
}
}
Usage
private getGames(): IGame[] {
const GS = new GamesService();
console.log(GS);
return [];
}
When I check the console output, it shows: GamesService {}
. However, I was expecting to see GamesService {getGames: f()}
.
If anyone could assist me, that would be greatly appreciated as I am still learning TypeScript :)