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

feature: compatibility with angular 17 #190

Closed MassonGuillaume closed 9 months ago

MassonGuillaume commented 10 months ago

Hello,

Please find a proposition for compatibility to angular 17. Feel free to merge / inspire or reject it as you prefer. This PR fix issue : #189 What I did is :

Thank you for the lib, Best

MassonGuillaume commented 9 months ago

Hello @mzuccaroli, can you take time to review this PR please ? Thanks ;)

mzuccaroli commented 9 months ago

@MassonGuillaume i have some issues testing it, wich version of node are you using?

MassonGuillaume commented 9 months ago

Hi @mzuccaroli, I have node 20 installed here.

mzuccaroli commented 9 months ago

I'm getting some problems, with node 18 and 20 with the provided package.lock.json I have this this error: npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @angular-devkit/build-angular@17.0.1 npm ERR! Found: ng-packagr@16.0.1 npm ERR! node_modules/ng-packagr npm ERR! dev ng-packagr@"~16.0.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional ng-packagr@"^17.0.0" from @angular-devkit/build-angular@17.0.1 npm ERR! node_modules/@angular-devkit/build-angular npm ERR! dev @angular-devkit/build-angular@"~17.0.1" from the root project npm ERR! npm ERR! Conflicting peer dependency: ng-packagr@17.0.2 npm ERR! node_modules/ng-packagr npm ERR! peerOptional ng-packagr@"^17.0.0" from @angular-devkit/build-angular@17.0.1 npm ERR! node_modules/@angular-devkit/build-angular npm ERR! dev @angular-devkit/build-angular@"~17.0.1" from the root project

if delete the package.lock tryng to regenerate it I'm getting

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: angular-google-tag-manager@1.8.0 npm ERR! Found: jasmine-core@5.1.1 npm ERR! node_modules/jasmine-core npm ERR! dev jasmine-core@"~5.1.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer jasmine-core@"^4.0.0" from karma-jasmine-html-reporter@2.0.0 npm ERR! node_modules/karma-jasmine-html-reporter npm ERR! dev karma-jasmine-html-reporter@"~2.0.0" from the root project npm ERR!

henriqueformiga commented 9 months ago

@MassonGuillaume , I think you need to update the version of ng-packagr to 17.0.2 and karma-jasmine-html-reporter to 2.1.0.This worked for me after reproducing the mentioned error

mzuccaroli commented 9 months ago

@henriqueformiga thank you, yopur suggestions fix the problem, working on the final build

mzuccaroli commented 9 months ago

version 1.9.0 released thank you @MassonGuillaume @henriqueformiga for the contribution