iziModal icon indicating copy to clipboard operation
iziModal copied to clipboard

userAgent not defined error in Angular app

Open ghost opened this issue 6 years ago • 3 comments

It was working fine before but not i am getting this error.

vendor.fb1f215fc8c60a68f625.bundle.js:1 ERROR ReferenceError: userAgent is not defined at t (https://uat.oxy-gen.xyz/scripts.8898cf9fe513edc86eca.bundle.js:9:26980) at c.recalcWidth (https://XXXX.xyz/scripts.8898cf9fe513edc86eca.bundle.js:10:13204) at c.init (https://XXXX.xyz/scripts.8898cf9fe513edc86eca.bundle.js:9:30207) at new c (https://XXXXX.xyz/scripts.8898cf9fe513edc86eca.bundle.js:9:27648) at me.fn.init.e.fn.(anonymous function) [as iziModal] (https://uat.oxy-gen.xyz/scripts.8898cf9fe513edc86eca.bundle.js:10:18675) at l.ngOnInit (https://XXXX.xyz/main.e8260690ee2ec506bb17.bundle.js:1:2844401) at xn (https://XXXX.xyz/vendor.fb1f215fc8c60a68f625.bundle.js:1:50009) at pr (https://XXXX.xyz/vendor.fb1f215fc8c60a68f625.bundle.js:1:65101) at lr (https://XXXX.xyz/vendor.fb1f215fc8c60a68f625.bundle.js:1:64640) at Nr (https://XXXX.xyz/vendor.fb1f215fc8c60a68f625.bundle.js:1:70956)

when i checked with old file of izimodal.min.js there is new line of code

(userAgent=navigator.userAgent,userAgent.indexOf("MSIE ")>-1||userAgent.indexOf("Trident/")>-1)

Angular app which uses typescript will not accept undefined parameters. Please check the issue and release a fix.

ghost avatar Oct 30 '17 11:10 ghost

try replace: userAgent = navigator.userAgent; return userAgent.indexOf("MSIE ") > -1 || userAgent.indexOf("Trident/") > -1; with var userAgent = navigator.userAgent; return userAgent.indexOf("MSIE ") > -1 || userAgent.indexOf("Trident/") > -1;

ernesthernandez avatar Nov 15 '17 00:11 ernesthernandez

I'll fix it, thanks.

marcelodolza avatar Nov 15 '17 09:11 marcelodolza

#187 #198 and probably a few more could be closed by this hotfix. I'm happy to do a pull if it helps.

RiFi2k avatar Jul 07 '18 02:07 RiFi2k