angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

TypeError: Object doesn't support this property or methodundefined

Open kvarc7 opened this issue 13 years ago • 4 comments

Hi all,

I have some problems with IE8, seem it's related with $http, $q. my get method in service is:

getDataByRadiusSearch: function (searchParams, searchField, searchTerm) {
            var deferred = $q.defer(); //promise
            $http({
                params: { lat: searchParams.latitude, lng: searchParams.longitude, miles: searchParams.radius, searchField: searchField, searchTerm: searchTerm },
                method: 'GET',
                url: '/api/data/dataByRadius'
            }).
            success(function (data, status, headers, config) {
                deferred.resolve(data);
            }).error(function (data, status, headers, config) {
                deferred.reject(status);
            });
            return deferred.promise;
        }

and in my controller i'm using follow code to fetch the data:

data.getDataByRadiusSearch(sp, "", "").then(function (data) {
            $scope.data = data;
        }, function (status) {
            console.log(status);
        });
}

And this perfectly works in all browsers but in IE8, there is javascript error : TypeError: Object doesn't support this property or methodundefined that screw up the app. Any idea what is the problem? By the way i'm using angular v1.2.0-rc.2 version. Thanks in advance

kvarc7 avatar Sep 27 '13 23:09 kvarc7

I just debugged it in IE8 and code breaks in angular.js on line 10286 on try block!!!

//down while you can, then up and next sibling or up and next sibling until back at root
        do {
          current = next;
          event.currentScope = current;
          listeners = current.$$listeners[name] || [];
          for (i=0, length = listeners.length; i<length; i++) {
            // if listeners were deregistered, defragment the array
            if (!listeners[i]) {
              listeners.splice(i, 1);
              i--;
              length--;
              continue;
            }

            try {
              listeners[i].apply(null, listenerArgs);
            } catch(e) {
             $exceptionHandler(e);
            }
          }

kvarc7 avatar Sep 27 '13 23:09 kvarc7

Switched back to 1.0.8 version and removed ngRoute dependency from app declaration.

var mainApp = angular.module('mainApp ', ['ngRoute']).

and now app is working in IE8 as well.

kvarc7 avatar Sep 28 '13 09:09 kvarc7

Looks like a duplicate of #3971. Let me know if this is incorrect and I'll reopen the issue.

In the future, please search existing issues before creating a new one. Thanks.

btford avatar Oct 03 '13 00:10 btford

Hi Brian, yea, seems they point to the same issue. https://github.com/IgorMinar/angular.js/commit/7679de324e249aa9235df66aa5301b80ebc6a965

Sorry for duplication, I promise, will not do this in future... ;-)

kvarc7 avatar Oct 16 '13 19:10 kvarc7