sciactive / pnotify

Beautiful JavaScript notifications with Web Notifications support.
https://sciactive.com/pnotify/
Apache License 2.0
3.65k stars 514 forks source link

Pnotify for angular throws syntax error in IE. #343

Closed Sonik20 closed 5 years ago

Sonik20 commented 6 years ago

@hperrin Can you please help here. Thanks 2018-06-01_15-23-22

munisravan commented 5 years ago

I'm facing the same problem, can someone help in this context.

smithk58 commented 5 years ago

This is happening because they're using arrow functions, which can't be polyfilled back into older browsers like IE. So you'll have to use the ES5 js files if you want to support older browsers. Those don't appear to import nicely into Angular 6 though for some reason, but I'll update this if I figure that part out.

Edit: So to get around it you can add the iife PNotify/PNotifyButtons scripts to your angular.json scripts": [ "./node_modules/pnotify/dist/iife/Pnotify.js", "./node_modules/pnotify/dist/iife/PNotifyButtons.js" ]

Then in your pnotify service up in your imports section add the following to make it not complain about them not existing: declare var PNotifyButtons: any; declare var PNotify: any;

munisravan commented 5 years ago

Thank you @smithk58 for your hepl, your solution fixed my app in IE.

hperrin commented 5 years ago

Thanks, @smithk58!