{"action":"created","issue":{"url":"https://api.github.com/repos/cgross/angular-busy/issues/77","labels_url":"https://api.github.com/repos/cgross/angular-busy/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/cgross/angular-busy/issues/77/comments","events_url":"https://api.github.com/repos/cgross/angular-busy/issues/77/events","html_url":"https://github.com/cgross/angular-busy/issues/77","id":103942186,"number":77,"title":"Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!","user":{"login":"mukulgupta2507","id":4299536,"avatar_url":"https://avatars.githubusercontent.com/u/4299536?v=3","gravatar_id":"","url":"https://api.github.com/users/mukulgupta2507","html_url":"https://github.com/mukulgupta2507","followers_url":"https://api.github.com/users/mukulgupta2507/followers","following_url":"https://api.github.com/users/mukulgupta2507/following{/other_user}","gists_url":"https://api.github.com/users/mukulgupta2507/gists{/gist_id}","starred_url":"https://api.github.com/users/mukulgupta2507/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mukulgupta2507/subscriptions","organizations_url":"https://api.github.com/users/mukulgupta2507/orgs","repos_url":"https://api.github.com/users/mukulgupta2507/repos","events_url":"https://api.github.com/users/mukulgupta2507/events{/privacy}","received_events_url":"https://api.github.com/users/mukulgupta2507/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-30T19:46:06Z","updated_at":"2015-10-19T12:12:19Z","closed_at":null,"body":"Hi,\r\n\r\nI have recently integrated angular-busy in my project. As soon as I integrated in my project, it started giving me following error:\r\n\r\n```\r\nError: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!\r\nWatchers fired in the last 5 iterations: [[{\"msg\":\"fn: regularInterceptedExpression\",\"newVal\":64,\"oldVal\":63}],[{\"msg\":\"fn: regularInterceptedExpression\",\"newVal\":65,\"oldVal\":64}],[{\"msg\":\"fn: regularInterceptedExpression\",\"newVal\":66,\"oldVal\":65}],[{\"msg\":\"fn: regularInterceptedExpression\",\"newVal\":67,\"oldVal\":66}],[{\"msg\":\"fn: regularInterceptedExpression\",\"newVal\":68,\"oldVal\":67}]]\r\nhttp://errors.angularjs.org/1.4.5/$rootScope/infdig?p0=10&p1=%5B%5B%7B%22ms…rInterceptedExpression%22%2C%22newVal%22%3A68%2C%22oldVal%22%3A67%7D%5D%5D\r\n    at REGEX_STRING_REGEXP (angular.js:68)\r\n    at Scope.$get.Scope.$digest (angular.js:15753)\r\n    at Scope.$get.Scope.$apply (angular.js:15986)\r\n    at angular.js:17753\r\n    at completeOutstandingRequest (angular.js:5490)\r\n    at angular.js:5762(anonymous function) @ angular.js:12416$get @ angular.js:9203$get.Scope.$apply @ angular.js:15988(anonymous function) @ angular.js:17753completeOutstandingRequest @ angular.js:5490(anonymous function) @ angular.js:5762\r\nangular.js:68 Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!\r\nWatchers fired in the last 5 iterations: [[{\"msg\":\"fn: regularInterceptedExpression\",\"newVal\":64,\"oldVal\":63}],[{\"msg\":\"fn: regularInterceptedExpression\",\"newVal\":65,\"oldVal\":64}],[{\"msg\":\"fn: regularInterceptedExpression\",\"newVal\":66,\"oldVal\":65}],[{\"msg\":\"fn: regularInterceptedExpression\",\"newVal\":67,\"oldVal\":66}],[{\"msg\":\"fn: regularInterceptedExpression\",\"newVal\":68,\"oldVal\":67}]]\r\nhttp://errors.angularjs.org/1.4.5/$rootScope/infdig?p0=10&p1=%5B%5B%7B%22ms…rInterceptedExpression%22%2C%22newVal%22%3A68%2C%22oldVal%22%3A67%7D%5D%5D\r\n```\r\nI have searched on internet and it seems to be some angularjs issue which comes when there is some function which returns an array of objects.\r\n\r\nI'm using two promises as used in this plunker http://plnkr.co/edit/VO7K2eE7GmEp0UY9wmbi?p=preview mentioned in this thread https://github.com/cgross/angular-busy/issues/29.\r\n\r\nHere is my code of promises:\r\n\r\n```\r\n    $scope.removeUploadedFile = function(files, idx) {\r\n      // files.splice(idx, 1);\r\n      // console.log($scope.uploadedFiles);\r\n      // $scope.uploadedFiles = files;\r\n      // console.log($scope.uploadedFiles);\r\n      var fileId = files[idx]['result']['data']['filePublicId'];\r\n      console.log(\"remove file\");\r\n      $scope.removeFilePromise = Auth.deleteFile(fileId)   // First promise\r\n      .then(function(data){\r\n        console.log(\"index\");\r\n        console.log(idx);\r\n        files.splice(idx, 1);\r\n        console.log($scope.uploadedFiles);\r\n        $scope.uploadedFiles = files;\r\n        console.log($scope.uploadedFiles);        \r\n      })\r\n      .catch(function(err){\r\n        ToasterService.notify('error', \"Error!\", \"Please try again!!\");\r\n      });\r\n\r\n    }\r\n\r\n    $scope.upload = function(files) {\r\n        $scope.uploadedFiles = files;\r\n        angular.forEach(files, function(file) {\r\n            if (file && !file.$error) {\r\n                // if($scope.uploadedFiles.indexOf(file) == -1) {\r\n                //   $scope.uploadedFiles.push(file);\r\n                // }\r\n                file.showremoveButton = false;\r\n                file.upload = Upload.upload({\r\n                  url: 'uploader',\r\n                  file: file,\r\n                  userId: $scope.user._id\r\n                });\r\n                file.upload.then(function (response) {\r\n                  $timeout(function () {\r\n                    file.result = response;\r\n                    file.showremoveButton = true;\r\n                  });\r\n                }, function (response) {\r\n                  console.log(response);\r\n                  if (response.status == 500) {\r\n                    var idx = $scope.uploadedFiles.indexOf(file);\r\n                    $scope.uploadedFiles.splice(idx, 1);\r\n                    console.log($scope.uploadedFiles);\r\n                  }\r\n                });\r\n                $scope.fileUploadPromise = file.upload;  // Second promise\r\n                file.upload.progress(function (evt) {\r\n                  file.progress = Math.min(100, parseInt(100.0 * evt.loaded / evt.total));\r\n                  console.log(\"file progress\");\r\n                  console.log(file.progress);\r\n                });\r\n          }   \r\n        });\r\n        console.log(JSON.stringify($scope.uploadedFiles));\r\n        console.log(JSON.stringify(files));\r\n\r\n\r\n    }\r\n\r\n    <div class=\"loader\" cg-busy=\"{ promise: [ removeFilePromise, fileUploadPromise ], message:message }\">&nbsp;</div>\r\n```\r\n\r\nCan anyone please help me where exactly am I doing wrong ?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/cgross/angular-busy/issues/comments/149197204","html_url":"https://github.com/cgross/angular-busy/issues/77#issuecomment-149197204","issue_url":"https://api.github.com/repos/cgross/angular-busy/issues/77","id":149197204,"user":{"login":"JosephDAM","id":6605055,"avatar_url":"https://avatars.githubusercontent.com/u/6605055?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephDAM","html_url":"https://github.com/JosephDAM","followers_url":"https://api.github.com/users/JosephDAM/followers","following_url":"https://api.github.com/users/JosephDAM/following{/other_user}","gists_url":"https://api.github.com/users/JosephDAM/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephDAM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephDAM/subscriptions","organizations_url":"https://api.github.com/users/JosephDAM/orgs","repos_url":"https://api.github.com/users/JosephDAM/repos","events_url":"https://api.github.com/users/JosephDAM/events{/privacy}","received_events_url":"https://api.github.com/users/JosephDAM/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T12:12:19Z","updated_at":"2015-10-19T12:12:19Z","body":"Same problem, but #29 says that `cg-busy=\"{ promise: [ removeFilePromise, fileUploadPromise ] }\"` does NOT work. My problem is that `$scope.promises = [$scope.promise1, $scope.promise2]` +  `cg-busy=\"{ promise: promises }\"` does not start the cgBusy..."}}