8

I'm working on a massive application that uses AngularJs.

When I view the page in IE8 I get super nifty console errors like Object doesn't support property or method 'module', Object doesn't support property or method 'widget', unable to get value of the property 'controller': object is null or undefined, and IE really sucks, cant you just tell them to download chrome?

After fighting with it for a while I decided to log the typeof angular, to which the console returned undefined.

Everything works as expected in IE9, IE10, and all browsers that don't suck.

Please help!

Edit:

It appears that angular is undefined before it gets to my first controller, so I don't think it has to do with the ieshim ...

4
  • Super nifty? Never thought of describing it that way... :) Commented Apr 8, 2013 at 16:54
  • Have you been over docs.angularjs.org/guide/ie ? Commented Apr 8, 2013 at 16:57
  • jbabey: yeah, I've also implemented the angular-ui ieshiv.js after following that guide failed to solve my problem. Commented Apr 8, 2013 at 16:58
  • Did you check the document mode? See http://stackoverflow.com/a/33936714/483647 Commented Nov 26, 2015 at 10:52

4 Answers 4

5

I've been working with IE8 for six months now, feel your pain.

Without seeing your code it's hard exactly to say what's wrong

Here's a very very basic page I just tested with IE8, for you to compare against:

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
    <meta charset="utf-8">
    <title>Prompt Detail View</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- disable browser cache -->
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="pragma" content="no-cache" />


    <!--[if lte IE 8]>
    <script>
        document.createElement('ng-include');
        document.createElement('ng-pluralize');
        document.createElement('ng-view');
        // Optionally these for CSS
        document.createElement('ng:include');
        document.createElement('ng:pluralize');
        document.createElement('ng:view');
    </script>
    <![endif]-->

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
          <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/angular-1.0.2.js" ng:autobind></script>


<script>
var pageModule = angular.module('pageModule',[])
.controller('pageCtrl',function($scope) {
   $scope.foo = 'my foo'; 
});

</script>
</head>


<body>
    <div ng-app="pageModule"
        ng-controller="pageCtrl">
            {{foo}}
    </div>
</body>
</html>
Sign up to request clarification or add additional context in comments.

5 Comments

Thanks! I see a couple things here that i'm missing, i'll blindly add them in hopes for progress!
Yes, it works. But don't forget, that old browsers support only old versions of Angular. I use 1.2.4 with IE8 =)
I'd like to point out that I've never been comfortable inventing tags for the purposes of use with angular. It's non-semantic and non-standard. When angular provides ways to do it via data attributes, why would you consider going that route? In my opinion using your own (and angular-native) custom tags is akin to using flash.
@dudewad- agreed. The purpose of my above posting was for basic debugging and sanity check
@Saike Thanks... Your comment saved me... Spent more than couple of hours to find the broken place in angular. finally fixed by version change.
2

So this was totally my bad (or the guy that started this app months ago).

My application controller had var angular = angular || {} at the top, IE8 didn't agree with this declaration.

After removing that all is well.

Comments

2

I also had the same issue, my IE9 browser didn't recognize any AngularJs tag, after trying everything I decided to run the html file in a server and it worked.

To summerize, when I executed the file as follows it didn't work

file:///C:/AngularJS/firstTest.html

when I executed the file in the server as follows it did work

http://localhost:7001/AngularJS/firstTest.html

1 Comment

I know that if you want to use some modules (like ngResource) you have to have an active server.
0

var versionError = angular.module('versionErrors', [])
  .controller('versionCtrl', function($scope) {
    $scope.name = 'Shantha Moorthy K';
  });
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular.min.js"></script>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta charset="utf-8">
  <title>AngularJS with Lower version Error's</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>


<body>
  <div ng-app="versionErrors" ng-controller="versionCtrl">
    {{name}}
  </div>
</body>

</html>

Object doesn't support property or method 'module'

`If you are using AngularJS + Lower version of IE(8), Please include the content="IE=edge".

After include that you will overcome the below error's.

  1. Object expected
  2. Object doesn't support property or method 'module'` ##

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.