Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not just reference a function with ng-file-select #352

Closed
litera opened this issue Oct 10, 2014 · 2 comments
Closed

Why not just reference a function with ng-file-select #352

litera opened this issue Oct 10, 2014 · 2 comments

Comments

@litera
Copy link

litera commented Oct 10, 2014

It seems that one has to always provide a call to $scope function which includes some injectable parameters apparently ($files) because if you rename those parameters they aren't recognised.

Example HTML code from Demo:

<input type="file" ng-file-select="onFileSelect($files)" onclick="this.value=null">

I would rather see it as

<input type="file" ng-file-select="onFileSelect" onclick="this.value=null">

So no parameters and just function reference rather than a call.

  1. Is there any particular reason why it's implemented the way it is?
  2. Could implementation be changed according to this issue?
  3. What is $files injectable and where is it defined? Shouldn't it be documented?
@whisher
Copy link

whisher commented Oct 17, 2014

Hi, sorry to join the thread but I've got the same curiosity :)
Where does $files parameter come from ?
Thanks in advance.

@whisher
Copy link

whisher commented Oct 17, 2014

I found it

$timeout(function() {
                fn(scope, {
                    $files : files,
                    $event : evt
                });
            });

but imo it's quite useless you have got all the files
with

fileList = evt.__files_ || evt.target.files;

but may be I'm missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants