MeetmeLeave / ng-canvas-gauges

Angular2 component wrapper for the canvas-gauges library written by @Mikhus(https://github.com/Mikhus/canvas-gauges).
MIT License
38 stars 23 forks source link

not working on Safari - Unexpected keyword 'const' #4

Closed FazioNico closed 7 years ago

FazioNico commented 7 years ago

When using on Safari browser have the following error: SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.

safari version: Version 9.0.1 (10601.2.7.2) Please upd compliation settings in ./tsconfig.json as:

"target": "es6", to => "target": "es5",

;-)

MeetmeLeave commented 7 years ago

I will try to fix it during this week, is not that simple to just change the target compilation to be es5 as I will have to use babel and webpack to transform those source to be real es5 outputs. If I will just change compilation target, I will get a lot of errors related to the dependencies used by the lib, as those are targeting es6.

FazioNico commented 7 years ago

Ok so i'm using Ionicframework it compile ts code with Angular CLI simple presst and it work find for me. I've juste copy you're file into my project. tek a look: https://github.com/FazioNico/ionic-speedometer https://github.com/FazioNico/ionic-speedometer/tree/master/src/app/ngzio-gauge

MeetmeLeave commented 7 years ago

This one should be resolved now, I failed to find any old machine (both of my Mac and PC are running newer versions of browsers so I failed to reproduce the issue there) to properly test this, but code got traspiled and running with function closures instead of classes so it should be all good now.