0

This piece of code :

  if (window.angular.bootstrap) {
    //AngularJS is already loaded, so we can return here...
    console.log('WARNING: Tried to load angular more than once.');
    return;
  }

is contained in AngularJS version 1.2.26 and causing an issue for IE. Error message is "console is undefined". My fix is just to remove console.log ?

What is meaning of window.angular.bootstrap ?

blue-sky
  • 51,962
  • 152
  • 427
  • 752
  • What version of IE? This may be relevant: http://stackoverflow.com/questions/690251/what-happened-to-console-log-in-ie8 – Sherman Oct 14 '14 at 13:18
  • I believe you are loading angular more than once (it's written on the piece of code). If you do not load angular more than once, then you'll be fine. – GeoffreyB Oct 14 '14 at 13:19
  • use a polyfill for `console` for older IE versions – charlietfl Oct 14 '14 at 13:20

1 Answers1

0

As others have said in the comments, support of the console object and specifically console.log is not good for some versions IE, so that is why you are getting that error. There are many polyfills for logging, such as this one. Although, that is not your issue.

The reason you are even running this code in the first place, is because window.angular.bootstrap is not null or undefined, which implies you are loading Angular JS more than once.

Flynn
  • 5,903
  • 7
  • 38
  • 55