Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS Internet Explorer 9

I have small trouble with angularjs and internet explorer9. It look like, that angularjs is not loading correctly. If I starting ie with my application, nothing will work, but if I start the development tools of ie9 and refresh the page, my application will work and everything is loading and ready to use.

I have no idea, what happen and how to solve this issue. I using angularJs Version 1.1.5. Big thanks!

Update & Resolved

My problem was, that I had everywhere console.log (..). On FF or Chrome, everything works, but with II9, something happens, that ie stop after the statement console.log(...); After removing console.log(..) from my JavaScript, my application also works on IE7/8/9.

But ??

But I would ask why IE has so much problems with console.log?

like image 781
moohkooh Avatar asked Jun 10 '13 13:06

moohkooh


2 Answers

I run in to the same issue and what fixed it was creating window console in the parent controller before using it. You can add the following code and try.

window.console = window.console || {};
window.console.log = window.console.log || function() {};
like image 161
idealistic Avatar answered Oct 16 '22 19:10

idealistic


Use $log service. It will be injected in your controllers. https://docs.angularjs.org/api/ng/service/$log

like image 4
Pavel Nikolov Avatar answered Oct 16 '22 18:10

Pavel Nikolov