AngularJS Internet Explorer 9

烈酒焚心 提交于 2019-12-03 15:37:34

问题


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?


回答1:


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() {};



回答2:


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




回答3:


Are you making a call to console.log in your code? If yes, this will not be available in IE unless you open the dev tools.



来源:https://stackoverflow.com/questions/17025509/angularjs-internet-explorer-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!