{"action":"created","issue":{"url":"https://api.github.com/repos/flowjs/ng-flow/issues/308","repository_url":"https://api.github.com/repos/flowjs/ng-flow","labels_url":"https://api.github.com/repos/flowjs/ng-flow/issues/308/labels{/name}","comments_url":"https://api.github.com/repos/flowjs/ng-flow/issues/308/comments","events_url":"https://api.github.com/repos/flowjs/ng-flow/issues/308/events","html_url":"https://github.com/flowjs/ng-flow/issues/308","id":182473083,"number":308,"title":"Some events don't trigger the $digest cycle","user":{"login":"icruces","id":752676,"avatar_url":"https://avatars.githubusercontent.com/u/752676?v=3","gravatar_id":"","url":"https://api.github.com/users/icruces","html_url":"https://github.com/icruces","followers_url":"https://api.github.com/users/icruces/followers","following_url":"https://api.github.com/users/icruces/following{/other_user}","gists_url":"https://api.github.com/users/icruces/gists{/gist_id}","starred_url":"https://api.github.com/users/icruces/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icruces/subscriptions","organizations_url":"https://api.github.com/users/icruces/orgs","repos_url":"https://api.github.com/users/icruces/repos","events_url":"https://api.github.com/users/icruces/events{/privacy}","received_events_url":"https://api.github.com/users/icruces/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-12T09:08:00Z","updated_at":"2016-10-20T16:31:49Z","closed_at":null,"body":"I am not sure if this is a bug or an expected behaviour. In any case, I see an inconsistency across the different events.\r\n\r\nI have some handle methods for different events: **progress**, **error**, **retry**, **complete**, etc. Everything works fine but the **retry** event:\r\n\r\nflow-file-retry=\"retryEvent($file, $flow)\"\r\n\r\n```javascript\r\nfunction retryEvent($file, $flow) {\r\n  console.log(\"Retry\");\r\n  retryNotification(); // update a model-view variable\r\n}\r\n```\r\n\r\nThe handler method is called, the log is printed and the model is modified. But the view never refreshes.\r\n\r\nLooking at the source code, I can see why this happens:\r\n\r\n```javascript\r\n  var catchAllHandler = function(eventName){\r\n      var args = Array.prototype.slice.call(arguments);\r\n      args.shift();\r\n      var event = $scope.$broadcast.apply($scope, ['flow::' + eventName, flow].concat(args));\r\n      if ({\r\n        'progress':1, 'filesSubmitted':1, 'fileSuccess': 1, 'fileError': 1, 'complete': 1\r\n      }[eventName]) {\r\n        $scope.$apply();\r\n      }\r\n      if (event.defaultPrevented) {\r\n        return false;\r\n      }\r\n    };\r\n```\r\n\r\nBecause only some events are broadcasted by default, thery are the only one that trigger the $digest cicyle.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/flowjs/ng-flow/issues/comments/255158080","html_url":"https://github.com/flowjs/ng-flow/issues/308#issuecomment-255158080","issue_url":"https://api.github.com/repos/flowjs/ng-flow/issues/308","id":255158080,"user":{"login":"icruces","id":752676,"avatar_url":"https://avatars.githubusercontent.com/u/752676?v=3","gravatar_id":"","url":"https://api.github.com/users/icruces","html_url":"https://github.com/icruces","followers_url":"https://api.github.com/users/icruces/followers","following_url":"https://api.github.com/users/icruces/following{/other_user}","gists_url":"https://api.github.com/users/icruces/gists{/gist_id}","starred_url":"https://api.github.com/users/icruces/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icruces/subscriptions","organizations_url":"https://api.github.com/users/icruces/orgs","repos_url":"https://api.github.com/users/icruces/repos","events_url":"https://api.github.com/users/icruces/events{/privacy}","received_events_url":"https://api.github.com/users/icruces/received_events","type":"User","site_admin":false},"created_at":"2016-10-20T16:31:49Z","updated_at":"2016-10-20T16:31:49Z","body":"Thanks, I will do it."}}
{"actor":{"display_login":"icruces"}}