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

Add dynamic identifier on input type created by ng-file-upload directive. #1167

Closed
demon-user opened this issue Nov 27, 2015 · 7 comments
Closed

Comments

@demon-user
Copy link

i have two separate upload button for angular-file-upload. They both create separate input elements at the bottom of the body. As they look alike ( cannot be distinguished ). I want to differentiate them for testing purpose (e2e test selenium webdriver) by passing optional paramater to the directive, but they are treated as string and not evaluated on the input element. I have used new doctype attribute.
screenshot from 2015-11-27 12 29 30

@bikram-mits
Copy link

i am having same issue..we need different identifier so that it will be easier for us to upload the file in end to end test.

@danialfarid
Copy link
Owner

Feature added at version 10.0.3.
If you specify an id for your element, the input type file will have that id prefixed with ngf-.
So

<div id="myid" ngf-select>

will create

<input type="file"  id="ngf-myid" ...>

@demon-user
Copy link
Author

Thanks (y)

@vjuras
Copy link
Contributor

vjuras commented May 6, 2016

This doesn't work inside ng-repeat. For example

<div ng-repeat="...">
    <div id="myid-{{$index}}" ngf-select></div>
</div>

gives

<input type="file"  id="ngf-myid-{{$index}}" ...>

is where any other way to set unique identifier?

@danialfarid
Copy link
Owner

@vilmysj create a separate issue with jsfiddle to show the issue please.

@coryschires
Copy link

I'm having the same problem as @vilmysj when trying to set the id within a directive.

@vjuras
Copy link
Contributor

vjuras commented May 28, 2016

Here is separate issue #1529

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

5 participants