Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

angular.copy doesn't copy File object correctly #14352

Closed
@sbespaly

Description

@sbespaly

Note: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

angular.copy doesn't copy File object (part of file API) correctly. There was the same issue with Blob, but it was fixed.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).

var file = new File([], "filename");
var file2 = angular.copy(file);
//variable 'file2' is not valid, and can not be used with file API anymore.

What is the expected behavior?

copy function should create valid copy of File object, like it was made for Blob

What is the motivation / use case for changing the behavior?

File object and Blob are very common objects, but for some reason copy function doesn't copy File object, but do this for Blob's. This lead to unclear behavior of copy function.

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.

1.5.3 release and latest sources on GitHub,
All browsers affected
Don't have implementation in previous versions

Other information (e.g. stacktraces, related issues, suggestions how to fix)
add copy code for File object in function
function copyType(source) in file Angular.js line:886

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions