Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

TypeError: Object doesn't support this property or methodundefined #4184

Closed
davscro opened this issue Sep 27, 2013 · 4 comments
Closed

TypeError: Object doesn't support this property or methodundefined #4184

davscro opened this issue Sep 27, 2013 · 4 comments

Comments

@davscro
Copy link

davscro commented Sep 27, 2013

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

@davscro
Copy link
Author

davscro commented Sep 27, 2013

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

@davscro
Copy link
Author

davscro commented Sep 28, 2013

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.

@btford
Copy link
Contributor

btford commented Oct 3, 2013

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 btford closed this as completed Oct 3, 2013
@davscro
Copy link
Author

davscro commented Oct 16, 2013

Hi Brian,
yea, seems they point to the same issue. IgorMinar@7679de3

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants