[Vuejs]-How to get rid of error when using class inside class in TypeScript?

0๐Ÿ‘

โœ…

You basically never instantiate leadService field of GpbApi if I am see it correctly.

So, you should instantiate loadService field in gpbApi

class GpbApi {
  leadService = leadService;
}

0๐Ÿ‘

I would suggest removing typeof word from interface properties declaration like:

interface Vue {
  $gpbApi: gpbApi;
}

and the same with class definition:

class GpbApi {
  leadService!: leadService;
}

Leave a comment