I'm submitting a ...
Current behavior:
I am using angular.copy function in one of my projects in a function I use for file uploading. This project is being used in both mobile and desktop. I figured out that in iOS devices (I only tested it with iOS 10) angular.copy doesn't copy the files property of input element on neither Safari nor Chrome appropriately. It works perfect with other platforms like Android Chrome and MacOS safari and chrome
Expected / new behavior:
angular.copy should behave similary on iOS browsers as would behave in Android browsers
Minimal reproduction of the problem with instructions:
Here is a plunker , demonstrating length of files of input element before and after copy. Please try it on an iOS device to see the bug. http://plnkr.co/edit/7EBbitlnY8TRL7dD2QUe
Angular version: 1.4.x
Browser: [Mobile Chrome 59 | iOS 10 Safari ]
only on iOS devices
Anything else:
This doesn't look like a direct issue with AngularJS. As you're providing an HTML node, this code is going to be triggered when copying: https://github.com/angular/angular.js/blob/master/src/Angular.js#L1010
This is making use of Node.cloneNode, which looks like to have issues on iOS.
You can try it by running this fork on IOS: http://plnkr.co/edit/yal7FE7bBnMhhddwtvLp?p=preview (I added an alert when running Node.cloneNode)
Make sure to read https://github.com/angular/angular.js/issues/14352 as well.
(As explained in https://github.com/angular/angular.js/issues/14352#issuecomment-207063928, angular.copy() does not (and will not) handle all possible edge-cases. Its primary purpose is facilitating AngularJS's internal needs.)
Most helpful comment
This doesn't look like a direct issue with AngularJS. As you're providing an HTML node, this code is going to be triggered when copying: https://github.com/angular/angular.js/blob/master/src/Angular.js#L1010
This is making use of Node.cloneNode, which looks like to have issues on iOS.
You can try it by running this fork on IOS: http://plnkr.co/edit/yal7FE7bBnMhhddwtvLp?p=preview (I added an alert when running Node.cloneNode)
Make sure to read https://github.com/angular/angular.js/issues/14352 as well.