{"action":"created","issue":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/1335","repository_url":"https://api.github.com/repos/danialfarid/ng-file-upload","labels_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/1335/labels{/name}","comments_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/1335/comments","events_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/1335/events","html_url":"https://github.com/danialfarid/ng-file-upload/issues/1335","id":131942989,"number":1335,"title":"ngf-model-invalid not compatible with ng-messages","user":{"login":"adambuczynski","id":490562,"avatar_url":"https://avatars.githubusercontent.com/u/490562?v=3","gravatar_id":"","url":"https://api.github.com/users/adambuczynski","html_url":"https://github.com/adambuczynski","followers_url":"https://api.github.com/users/adambuczynski/followers","following_url":"https://api.github.com/users/adambuczynski/following{/other_user}","gists_url":"https://api.github.com/users/adambuczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/adambuczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambuczynski/subscriptions","organizations_url":"https://api.github.com/users/adambuczynski/orgs","repos_url":"https://api.github.com/users/adambuczynski/repos","events_url":"https://api.github.com/users/adambuczynski/events{/privacy}","received_events_url":"https://api.github.com/users/adambuczynski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2016-02-07T06:41:42Z","updated_at":"2016-05-05T19:33:25Z","closed_at":"2016-02-14T00:08:48Z","body":"Hi, first of all, I'm very impressed with how far this plugin has come and how much is possible to do with it out of the box. It's matured a lot over the past year.\r\n\r\nI have an issue I hope you can help with. I would like to use `ng-messages` to show validation errors coming out of `ng-file-upload`. However, the only way to do that currently seems to be by using a form and file input field.\r\n\r\nMy UI doesn't have that, instead I am using the file drop functionality in combination with a button to select files. So when browsing the documentation, I found the directive `ngf-model-invalid`, thinking it could be used for displaying errors with `ng-messages`.\r\n\r\nThe format of the error model however is incompatible with `ng-messages` or with the `form.field.$error` output; it expects something along the lines of:\r\n\r\n```js\r\ninvalidFiles[0].$error = {\r\n  pattern: true,\r\n  required: true\r\n}\r\n```\r\n\r\nbut instead it gets:\r\n\r\n```js\r\ninvalidFiles[0].$error = 'pattern'\r\n```\r\n\r\nCould you make the latter compatible by setting the `$error` field to be an object hash with the relevant errors in there?\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/comments/217253946","html_url":"https://github.com/danialfarid/ng-file-upload/issues/1335#issuecomment-217253946","issue_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/1335","id":217253946,"user":{"login":"adambuczynski","id":490562,"avatar_url":"https://avatars.githubusercontent.com/u/490562?v=3","gravatar_id":"","url":"https://api.github.com/users/adambuczynski","html_url":"https://github.com/adambuczynski","followers_url":"https://api.github.com/users/adambuczynski/followers","following_url":"https://api.github.com/users/adambuczynski/following{/other_user}","gists_url":"https://api.github.com/users/adambuczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/adambuczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambuczynski/subscriptions","organizations_url":"https://api.github.com/users/adambuczynski/orgs","repos_url":"https://api.github.com/users/adambuczynski/repos","events_url":"https://api.github.com/users/adambuczynski/events{/privacy}","received_events_url":"https://api.github.com/users/adambuczynski/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T19:33:25Z","updated_at":"2016-05-05T19:33:25Z","body":"@austin4perezident I believe I just manually cleared/reset the error object when a new file was selected. It was the easiest way to do it from what I remember."}}