{"action":"created","issue":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/764","labels_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/764/labels{/name}","comments_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/764/comments","events_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/764/events","html_url":"https://github.com/danialfarid/ng-file-upload/issues/764","id":81515962,"number":764,"title":"Don't call ngf-change with an empty files parameter","user":{"login":"lookfirst","id":85355,"avatar_url":"https://avatars.githubusercontent.com/u/85355?v=3","gravatar_id":"","url":"https://api.github.com/users/lookfirst","html_url":"https://github.com/lookfirst","followers_url":"https://api.github.com/users/lookfirst/followers","following_url":"https://api.github.com/users/lookfirst/following{/other_user}","gists_url":"https://api.github.com/users/lookfirst/gists{/gist_id}","starred_url":"https://api.github.com/users/lookfirst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookfirst/subscriptions","organizations_url":"https://api.github.com/users/lookfirst/orgs","repos_url":"https://api.github.com/users/lookfirst/repos","events_url":"https://api.github.com/users/lookfirst/events{/privacy}","received_events_url":"https://api.github.com/users/lookfirst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-27T16:12:10Z","updated_at":"2015-05-27T17:28:46Z","closed_at":null,"body":"@danialfarid What I'm seeing is that ngf-change is being called TWICE. Once when you click the button and the file chooser dialog opens and once when the dialog closes after selecting a file.\r\n\r\nI added this to your fiddle...\r\n\r\n```\r\n    $scope.upload = function (files) {\r\n        alert('called from upload. files is: ' + files);\r\n```\r\n\r\nWhatever is calling it shouldn't call it the first time. There is no reason to call $scope.upload if files is null. This would allow me to remove the null check and simplify things greatly."},"comment":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/comments/106005005","html_url":"https://github.com/danialfarid/ng-file-upload/issues/764#issuecomment-106005005","issue_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/764","id":106005005,"user":{"login":"danialfarid","id":1676054,"avatar_url":"https://avatars.githubusercontent.com/u/1676054?v=3","gravatar_id":"","url":"https://api.github.com/users/danialfarid","html_url":"https://github.com/danialfarid","followers_url":"https://api.github.com/users/danialfarid/followers","following_url":"https://api.github.com/users/danialfarid/following{/other_user}","gists_url":"https://api.github.com/users/danialfarid/gists{/gist_id}","starred_url":"https://api.github.com/users/danialfarid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danialfarid/subscriptions","organizations_url":"https://api.github.com/users/danialfarid/orgs","repos_url":"https://api.github.com/users/danialfarid/repos","events_url":"https://api.github.com/users/danialfarid/events{/privacy}","received_events_url":"https://api.github.com/users/danialfarid/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T17:28:46Z","updated_at":"2015-05-27T17:28:46Z","body":"If you cancel the popup file select, it should call ngf-change with null value.\r\nI might consider adding an option to not reset the model on file click, but that would not allow you to select the same file again or clear the model when the user cancels the popup."}}