mzuccaroli / angular-google-tag-manager

A service library for integrate google tag manager in your angular project
https://itnext.io/how-to-add-google-tag-manager-to-an-angular-application-fc68624386e2
MIT License
136 stars 78 forks source link

Unable to import angular-google-tag-manager-config.service #171

Closed strike2867 closed 1 year ago

strike2867 commented 1 year ago

Error: Can't resolve 'angular-google-tag-manager-config.service' in '...' Cannot find module 'angular-google-tag-manager-config.service' or its corresponding type declarations.

It looks as though GoogleTagManagerConfiguration is not exported.

pm20390 commented 1 year ago

I've added this commit to my fork.

lechatgraphique commented 1 year ago

Hi @pm20390,

Thanks for the fix on the import. The time that the modification is pushed, I made the modification on my side but it seems to have another error?

Error: export 'GoogleTagManagerConfiguration' (imported as 'GoogleTagManagerConfiguration') was not found in 'angular-google-tag-manager' (possibl e exports: GoogleTagManagerModule, GoogleTagManagerService)

public-api.ts export * from './lib/angular-google-tag-manager.service'; export * from './lib/angular-google-tag-manager.module'; export * from './lib/google-tag-manager-config'; export * from './lib/angular-google-tag-manager-config.service';

Best regard

pm20390 commented 1 year ago

Hi @lechatgraphique

I will double check later but that should be resolved by the last line in your public-api. I am using this currently without issue.

Are you sure you’ve imported GoogleTagManagerConfiguration correctly where you need to use it?

Best

lechatgraphique commented 1 year ago

Thank you for your reply. Logically it should work. I show you

public-api.d.ts image

app.module.ts image image image

pm20390 commented 1 year ago

If you need this change now, I would use my fork “ng-google-tag-manager” (available via npm) and then just switch back when it gets merged. Editing the .d.ts files for the built output won’t work.

lechatgraphique commented 1 year ago

Ok thanks, I will do that :)

lechatgraphique commented 1 year ago

Great thanks for the helping hand. It works damn ;)