{"id":18784908,"url":"https://github.com/ghostbar/angular-file-model","last_synced_at":"2025-04-13T12:33:35.675Z","repository":{"id":13591918,"uuid":"16284721","full_name":"ghostbar/angular-file-model","owner":"ghostbar","description":"Angular.js directive that allows input element's of type file to be handled in models inside a controller's scope","archived":false,"fork":false,"pushed_at":"2018-01-10T08:36:40.000Z","size":12,"stargazers_count":72,"open_issues_count":5,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-03-23T12:11:26.241Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostbar.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-27T16:25:57.000Z","updated_at":"2024-01-17T18:08:07.000Z","dependencies_parsed_at":"2022-09-09T13:21:01.369Z","dependency_job_id":null,"html_url":"https://github.com/ghostbar/angular-file-model","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbar%2Fangular-file-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbar%2Fangular-file-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbar%2Fangular-file-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbar%2Fangular-file-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostbar","download_url":"https://codeload.github.com/ghostbar/angular-file-model/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223588762,"owners_count":17169879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T20:44:25.951Z","updated_at":"2024-11-07T20:44:26.604Z","avatar_url":"https://github.com/ghostbar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"angular-file-model [![Code Climate](https://codeclimate.com/github/ghostbar/angular-file-model/badges/gpa.svg)](https://codeclimate.com/github/ghostbar/angular-file-model)\n==================\n\nSimple Angular.js directive that allows input element's of type `file` to be \nhandled in models inside a controller's scope.\n\nUsage\n-----\n\nInstall with bower:\n\n    bower install angular-file-model --save\n\nAdd to your HTML files:\n\n    \u003cscript src='/bower_components/angular-file-model/angular-file-model.js'\u003e\u003c/script\u003e\n\nNow, inject to your application:\n\n    angular.module('myApp', ['file-model']);\n\nReady to use in your controllers!:\n\n`file.html`:\n\n    \u003cinput type='file' file-model='fileModel'\u003e\n    \u003cbutton type='button' ng-click='upload()'\u003eUpload\u003c/button\u003e\n\n`controller.js:`\n\n    var DemoCtrl = [\n      '$scope', \n      function ($scope) {\n        $scope.upload = function () {\n          $scope.fileModel // This is where the file is linked to.\n        };\n      }\n    ]\n\nNeed an actual demo?\n--------------------\n\nGo and check this out \u003chttp://plnkr.co/edit/0ZHCsR\u003e.\n\nKnown Issues\n------------\n\n+ **Using a the modal controller from angular-ui I can't update the variable assigned to file-model**: This is not an issue directly with `angular-file-model`. It's created because the modal controller uses transclusion. Actually, you can't update any other values directly. My workaround for this has been passing an empty object to the controller's scope and putting the file-model (just like other data from fields from the modal) into that object, so what I pass to `file-model` is something like: 'data.file' instead and it works. (`data` being already initialized as `{}` at least in the controller)\n\nAuthor\n------\n© 2014, Jose Luis Rivas `\u003cme@ghostbar.co\u003e`. \n\nLicense\n-------\nThe files are licensed under the MIT terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostbar%2Fangular-file-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostbar%2Fangular-file-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostbar%2Fangular-file-model/lists"}