naikus / svg-gauge

Minimalistic, animated SVG gauge. Zero dependencies
MIT License
319 stars 74 forks source link

Experiencing a ReferenceError: k is not defined (gauge.js) #33

Closed coltenkrauter closed 5 years ago

coltenkrauter commented 5 years ago

I am implementing this neat svg-gauge via the wrapper that @mattlewis92 made here

I am experiencing a ReferenceError, k is not defined when I try to run my Angular 8 app with an svg-gauge in it.

Per the console error, it seems that this is the line of code that I am battling: https://github.com/naikus/svg-gauge/blob/master/src/gauge.js#L96

Would you be able to modify this line (or I could create a PR..?),

FROM

for(k in s) {

TO

for(let k in s) {

I am hoping that this will solve my problems. If you have any other advice, it will be much appreciated.

Screenshot: image

https://angular-ssr-example.coltenkrauter.com https://github.com/coltenkrauter/angular-ssr-example

naikus commented 5 years ago

Hi @coltenkrauter Thanks for reporting this! This has been fixed in 1.0.6 version of the library in npm.

coltenkrauter commented 5 years ago

Fantastic! Thanks @naikus for the quick response.

coltenkrauter commented 5 years ago

Lastly, @mattlewis92, will you update the svg-gauge reference in the angular wrapper to use version 1.0.6?

https://github.com/mattlewis92/angular-gauge/blob/master/package.json#L122

mattlewis92 commented 5 years ago

@coltenkrauter released as 3.1.2 😄

coltenkrauter commented 5 years ago

Thanks a lot @mattlewis92 - I can confirm, it is now working as expected. I really appreciate your helpfulness.