{"action":"opened","issue":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/986","labels_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/986/labels{/name}","comments_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/986/comments","events_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/986/events","html_url":"https://github.com/danialfarid/ng-file-upload/issues/986","id":104577803,"number":986,"title":"ng-model not populated by files on change","user":{"login":"Sebi55","id":923505,"avatar_url":"https://avatars.githubusercontent.com/u/923505?v=3","gravatar_id":"","url":"https://api.github.com/users/Sebi55","html_url":"https://github.com/Sebi55","followers_url":"https://api.github.com/users/Sebi55/followers","following_url":"https://api.github.com/users/Sebi55/following{/other_user}","gists_url":"https://api.github.com/users/Sebi55/gists{/gist_id}","starred_url":"https://api.github.com/users/Sebi55/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sebi55/subscriptions","organizations_url":"https://api.github.com/users/Sebi55/orgs","repos_url":"https://api.github.com/users/Sebi55/repos","events_url":"https://api.github.com/users/Sebi55/events{/privacy}","received_events_url":"https://api.github.com/users/Sebi55/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-02T21:44:50Z","updated_at":"2015-09-02T21:44:50Z","closed_at":null,"body":"Hey thanks for the great plugin.\r\nI have got the problem that I want the user to select an image, he can than see a preview of it and then hit the submit button to really upload it. I already got another upload working where I upload a video to my server but I somehow cannot get the image upload to work. When I drop the image it works perfectly and I can see the preview but if select it by clicking instead of dragging the model is not updated, if try to use ngf-change and manually place the file into files I get the error that file is null and if I do $watch then I also get back that it is null. Furthermore if I select a file for the first time nothing happens it only does anything on the second try to select something.\r\nThe crazy thing is that it works for me for the video without any problem. The only difference is that I directly upload the video instead of waiting for a submit but that should not change the select thing shouldn't it?\r\nHere my code:\r\n```html\r\n<form name=\"create-artist\">\r\n    \t<input type=\"text\" name=\"artistname\" placeholder=\"Band- oder Künstlername\" />\r\n      \t<div ngf-drop ngf-select ng-model=\"files\" ngf-multiple=\"true\" ngf-pattern=\"image/*\" accept=\"image/*\" ngf-validate=\"{pattern: 'image/*'}\" class=\"upload-container\">\r\n\t\t\t<div class=\"content\">\r\n\t\t\t\t<h5>Lade Dein Video Hoch</h5>\r\n\t\t\t\t<h6>Videodatei für Upload ziehen und ablegen</h6>\r\n\t\t\t\t<div class=\"upload-icon\"></div>\r\n\t\t\t\t<span class=\"t\">Oder:</span>\r\n\t\t\t\t<div ngf-pattern=\"image/*\" accept=\"image/*\" ngf-validate=\"{pattern: 'image/*'}\">\r\n\t\t\t\t\t<span>Durchsuchen</span>\r\n\t\t\t\t</div>\r\n\t\t\t\t<h6>Dein Video wird dann sofort hochgeladen!</h6>\r\n\t\t\t</div>\r\n\t\t\t<img ngf-src=\"files[0]\">\r\n\t\t</div>\r\n      <input type=\"button\" name=\"create\" value=\"Erstellen\" ng-click=\"doit()\"/>\r\n </form>\r\n```\r\nAnd here my controller:\r\n```javascript\r\napp.controller('createArtistCtrl', function($scope, Login, $location, Upload, $interval){\r\n    $scope.$watch('files', function () {\r\n        console.log($scope.files);\r\n    });\r\n    $scope.upload = function(files) {\r\n        $scope.progressPercentage = 0;\r\n        $scope.uploaded = false;\r\n        var video_data = {\r\n            \"title\": $scope.title,\r\n            \"genre_id\": $scope.genre\r\n        };\r\n        console.log(video_data);\r\n        if ($scope.files.length > 0) {\r\n            Upload.upload({\r\n                url: base + '/postImage',\r\n                headers: {\r\n                    'Content-Type': $scope.files[0].type\r\n                },\r\n                method: 'POST',\r\n                data: $scope.files[0],\r\n                file: $scope.files[0],\r\n            }).progress(function(evt) {\r\n                $scope.progressPercentage = parseInt(100.0 * evt.loaded / evt.total);\r\n            }).success(function(data, status, headers, config) {\r\n                console.log(data);\r\n                $scope.path = data;\r\n                $scope.uploaded = true;\r\n            });\r\n        }\r\n    };\r\n   $scope.doit= function(){\r\n   \tconsole.log($scope.files);\r\n   }\r\n});\r\n```\r\nMaybe I should mention that this form is shown inside a ngDialog modal. I apply the controller using like that: \r\n```javascript\r\nngDialog.open({\r\n    \t\ttemplate: '../../themes/default/createartistmodal.html',\r\n    \t\tscope: $scope,\r\n    \t\tcontroller: 'createArtistCtrl'\r\n    \t});\r\n```\r\n\r\nIt should not be a problem since a new controller is applied and anything is done inside this controller and the drop function is working so there need to be another error.\r\nI hope you can help me."}}