cgross / angular-busy

Show busy/loading indicators on any element during $http requests (or any promise).
http://cgross.github.io/angular-busy/demo
MIT License
1.44k stars 256 forks source link

Not working with angular 1.3.0.rc.3 #44

Closed LeleDev closed 9 years ago

LeleDev commented 10 years ago

With angular 1.3.0.rc.3 I get the following error:

TypeError: Cannot read property '$$state' of undefined
    at Uc.d.then (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.3/angular.min.js:107:139)
    at d (file:///mnt/Partizione1/Lele/Lavoro/Github%20projects/k2hire/bower_components/angular-busy/dist/angular-busy.min.js:1:940)
    at file:///mnt/Partizione1/Lele/Lavoro/Github%20projects/k2hire/bower_components/angular-busy/dist/angular-busy.min.js:1:349
    at Object.r [as forEach] (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.3/angular.min.js:7:298)
    at Object.c.reset (file:///mnt/Partizione1/Lele/Lavoro/Github%20projects/k2hire/bower_components/angular-busy/dist/angular-busy.min.js:1:294)
    at file:///mnt/Partizione1/Lele/Lavoro/Github%20projects/k2hire/bower_components/angular-busy/dist/angular-busy.min.js:1:2252
    at Object.fn (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.3/angular.min.js:117:127)
    at k.$digest (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.3/angular.min.js:118:250)
    at k.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.3/angular.min.js:121:264)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.3/angular.min.js:18:101 angular.js:10683(anonymous function) angular.js:10683(anonymous function) angular.js:7858k.$digest angular.js:13292k.$apply angular.js:13540(anonymous function) angular.js:1483e angular.js:4112d angular.js:1481ic angular.js:1501xd angular.js:1395(anonymous function) angular.js:24696j jquery.min.js:2k.fireWith jquery.min.js:2n.extend.ready jquery.min.js:2I jquery.min.js:

It works fine instead with angular 1.2.25

devniel commented 10 years ago

I've got some errors with 1.3.0.rc.3 too

smithkl42 commented 10 years ago

Ditto (except with rc2).

TypeError: Cannot read property '$$state' of undefined
    at Promise.then (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.2/angular.js:12184:11)
    at addPromiseLikeThing (http://dev.payboard.com/bower_components/angular-busy/angular-busy.js:67:4)
    at http://dev.payboard.com/bower_components/angular-busy/angular-busy.js:22:5
    at Object.forEach (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.2/angular.js:331:20)
    at Object.tracker.reset (http://dev.payboard.com/bower_components/angular-busy/angular-busy.js:18:12)
    at http://dev.payboard.com/bower_components/angular-busy/angular-busy.js:175:15
    at Object.$watchCollectionAction [as fn] (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.2/angular.js:13125:13)
    at Scope.$get.Scope.$digest (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.2/angular.js:13262:29)
    at Scope.$get.Scope.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.2/angular.js:13528:24)
    at done (http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.2/angular.js:8893:47) 
vlad13-code commented 10 years ago

Same problem with 1.3.0.rc.4

LeleDev commented 10 years ago

This one seems to help: https://github.com/cgross/angular-busy/pull/37

kaifer commented 9 years ago

I've got some errors with 1.3.0.rc.4 too.

No more error occurred since I have fixed some lines of the source code. but, I do not consider another version. line 67 (in angular-busy.js)

Before

        then(function(){
            promise.$cgBusyFulfilled = true;
            if (tracker.promises.indexOf(promise) === -1) {
                return;
            }
            tracker.promises.splice(tracker.promises.indexOf(promise),1);
        },function(){
            promise.$cgBusyFulfilled = true;
            if (tracker.promises.indexOf(promise) === -1) {
                return;
            }
            tracker.promises.splice(tracker.promises.indexOf(promise),1);
        });

After

        var onFulfilled = function(){
            promise.$cgBusyFulfilled = true;
            if (tracker.promises.indexOf(promise) === -1) {
                return;
            }
            tracker.promises.splice(tracker.promises.indexOf(promise),1);
        };
        var onRejected = function(){
            promise.$cgBusyFulfilled = true;
            if (tracker.promises.indexOf(promise) === -1) {
                return;
            }
            tracker.promises.splice(tracker.promises.indexOf(promise),1);
        };
        then.call(promise,onFulfilled,onRejected);
dlouwers commented 9 years ago

Can we get a release for bower? I can patch it locally but don't know how to distribute this to the team.

venkatramachandran commented 9 years ago

After making this change, I get the following error (with angular 1.3.0-rc.4 ):

TypeError: Cannot read property 'pending' of undefined
    at Resource.Promise.then (http://192.168.56.102:90/bower_components/angular/angular.js:12252:42)
    at addPromiseLikeThing (http://192.168.56.102:90/bower_components/angular-busy/angular-busy.js:81:12)
    at http://192.168.56.102:90/bower_components/angular-busy/angular-busy.js:22:9
    at Object.forEach (http://192.168.56.102:90/bower_components/angular/angular.js:330:20)
    at Object.tracker.reset (http://192.168.56.102:90/bower_components/angular-busy/angular-busy.js:18:15)
    at http://192.168.56.102:90/bower_components/angular-busy/angular-busy.js:177:21
    at Object.$watchCollectionAction [as fn] (http://192.168.56.102:90/bower_components/angular/angular.js:13206:13)
    at Scope.$digest (http://192.168.56.102:90/bower_components/angular/angular.js:13341:29)
    at Scope.$apply (http://192.168.56.102:90/bower_components/angular/angular.js:13603:24)
    at done (http://192.168.56.102:90/bower_components/angular/angular.js:8935:47) 

Any ideas to fix this?

cheneywan commented 9 years ago

Same problem with 1.3.0

TypeError: Cannot read property '$$state' of undefined at Promise.then (http://localhost:8080/py6/js/vendor.js:12876:11) at addPromiseLikeThing (http://localhost:8080/py6/js/vendor.js:29226:4) at http://localhost:8080/py6/js/vendor.js:29181:5 at Object.forEach (http://localhost:8080/py6/js/vendor.js:335:20) at Object.tracker.reset (http://localhost:8080/py6/js/vendor.js:29177:12) at http://localhost:8080/py6/js/vendor.js:29334:15 at Object.$watchCollectionAction as fn at Scope.$digest (http://localhost:8080/py6/js/vendor.js:13965:29) at Scope.$apply (http://localhost:8080/py6/js/vendor.js:14227:24) at HTMLButtonElement. (http://localhost:8080/py6/js/vendor.js:33091:13)

ALMMa commented 9 years ago

@kaifer's approach worked here too, with default settings.

hyzhak commented 9 years ago

+1

hyzhak commented 9 years ago

@cgross pls pull my request and publish new update to the bower we need it to use new version of angular 1.3

hyzhak commented 9 years ago

@cgross sorry, I just can't wait for new version of angular-busy, so I've created temporary bower module with this pull request. It can be installed that way:

$ bower info angular-busy-too --save
cgross commented 9 years ago

Fixed and published to bower. Thanks guys.

marcelorl commented 8 years ago

Hi,

I had the same issue again with angular 1.4.8, then I implemented @kaifer solution and it worked smoothly. Could you please pull his solution to the project?

Thanks.

orcunland commented 7 years ago

Hi,

I am now experiencing the same problem with AngularJS 1.6.4 after upgrading my Angular version from 1.2.16. I am using bower 1.8.0 version.