I have a service generated with CLI that stores an object:
public tutorial: Object = {
amountMin: 5,
amountMax: 5,
characters: 100,
spells: 100,
consumable: 100,
gold: 90
};
and when I import that service into the constructor of the component like this
constructor(
private Packs: PacksService
) {}
I can console.log(this.Packs.tutorial)
and get the object I have in the service. But if I want to use this.Packs.tutorial.gold
, for example, it says:
[ts] Property 'gold' does not exist on type 'Object'. any