question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ngf-keep="distinct" removes all files from the model before adding new files - is this how it should work?

See original GitHub issue

If I have

 <button type="button" ngf-select ng-model="uploadFiles" name="uploadFiles"
                          ngf-multiple="true"
                          ngf-keep="distinct"
                          >Add files</button>

my intuitive expectation would be that each time I click the button and select files, the new files should be added to $scope.uploadFiles and the old ones should still remain in the model. Only if I select the same file twice, it will be ignored in the model. But currently, each time I click the button my $scope.uploadFiles gets completely cleared out.

If I set ngf-keep="true" then $scope.uploadFiles is not cleared out, but then, obviously, duplicate files are not filtered either.

Is there any way to make distinct work similar to true and ignore only duplicate files without clearing out all the other ones from $scope.uploadFiles ?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danialfaridcommented, Oct 13, 2015

Updated the docs to show the quotations.

0reactions
danialfaridcommented, Oct 13, 2015

It should be ngf-keep="'distinct'" note the quotation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Replace instead of delete and add file with ngFileUpload
How can new files simply replace old ones without deleting the old one on click? Another option would be to use the ngf-before-model-change ......
Read more >
git-rm Documentation - Git
Remove files matching pathspec from the index, or from the working tree and the index. git rm will not remove a file from...
Read more >
Unstage - GitLab Docs
Unstage. all tiers. To remove files from stage use reset HEAD where HEAD is the last commit of the current branch. This unstages...
Read more >
Manage files under version control - PyCharm - JetBrains
Put any files in the Unversioned Files changelist under version control by pressing Ctrl+Alt+A or selecting Add to VCS from the context menu....
Read more >
Delete files in iCloud Drive on iCloud.com - Apple Support
Files you delete from iCloud Drive are recoverable for 30 days, but you can remove deleted files before the 30-day time period is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found