You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
other (Please do not submit support requests here (see above))
Current behavior:
angular.merge doesn't copy Blob objects from source to destination.
The property is copied but the value is no longer a Blob object but an empty Object.
Expected / new behavior:
The expected behaviour would be to copy the Blob as is from source to destination. Object.assign behaves this way (doesn't have this bug).
Minimal reproduction of the problem with instructions:
var aFileParts = ['<a id="a"><b id="b">hey!</b></a>']; // an array consisting of a single DOMString
var oMyBlob = new Blob(aFileParts, {type : 'text/html'}); // the blob
var obj1 = {blob: oMyBlob, foo: 1};
var obj2 = angular.merge({}, obj1, {foo: 2});
var obj3 = Object.assign({}, obj1, {foo: 2});
console.assert(obj2.blob instanceof Blob === obj3.blob instanceof Blob, 'angular.merge should copy Blobs like Object.assign');
Angular version: 1.6.1
Browser: [Chrome 57 Mac OS X El Capitan ]
Anything else:
The text was updated successfully, but these errors were encountered:
I would like to talk abiut this with the team as I think we should deprecate angular.merge, as it is not used inside core. Devs should use Object assign or lodash instead
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Jun 6, 2017
This function has problems with special object types but since it's not used in core,
it is not worth implementing fixes for these cases.
A general purpose library like lodash (provides `merge`) should be used instead.
Closesangular#12653Closesangular#14941Closesangular#15180Closesangular#15992
This function has problems with special object types but since it's not used in core,
it is not worth implementing fixes for these cases.
A general purpose library like lodash (provides `merge`) should be used instead.
Closesangular#12653Closesangular#14941Closesangular#15180Closesangular#15992
This function has problems with special object types but since it's not used in core,
it is not worth implementing fixes for these cases.
A general purpose library like lodash (provides `merge`) should be used instead.
Closes#12653Closes#14941Closes#15180Closes#15992Closes#16036
This function has problems with special object types but since it's not used in core,
it is not worth implementing fixes for these cases.
A general purpose library like lodash (provides `merge`) should be used instead.
Closes#12653Closes#14941Closes#15180Closes#15992Closes#16036
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm submitting a ...
Current behavior:
angular.merge
doesn't copyBlob
objects from source to destination.The property is copied but the value is no longer a
Blob
object but an emptyObject
.Expected / new behavior:
The expected behaviour would be to copy the
Blob
as is from source to destination.Object.assign
behaves this way (doesn't have this bug).Minimal reproduction of the problem with instructions:
Angular version: 1.6.1
Browser: [Chrome 57 Mac OS X El Capitan ]
Anything else:
The text was updated successfully, but these errors were encountered: