Recently, I sought help with a question similar to this one and despite receiving assistance, I am still struggling with the code.
In my typescript
file, I have created a small service to work with the google api
(referred to as gapi) along with an interface. Here is a snippet from my code;
gapiService.ts
class GoogleAuthenticationService implements IGoogleAuthenticationService {
// ...
}
interface IGoogleAuthenticationService extends ng.IServiceProvider { }
Although this setup works fine, I am quite particular about keeping things organized and wish to integrate them into the angular
namespace/module so they can be part of the ng
loading process. Thus, allowing me to reference them like...
ng.GoogleAuthenticationService
ng.IGoogleAuthenticationService
I tried implementing this solution but encountered errors indicating that the elements could not be found or other issues. The errors I observed are listed below...
Property 'GoogleAuthenticationService' does not exist on type 'IAngularStatic'
Module 'angular' has no exported member 'IGoogleAuthenticationService'
An export assignment cannot be used in a module with other exported elements.
Do you have any suggestions on how I can achieve what I am trying to do? It's really frustrating me.
gapiAuth.d.ts
declare module 'angular' {
interface IGoogleAuthenticationService{}
var GoogleAuthenticationService: GoogleAuthenticationService
}