Is the code below still the only way to set the required AngularJS XSRF token when uploading or removing files? The value of the token needs to be taken from the XSRF-TOKEN cookie.
function onUpload(e) {
var xhr = e.XMLHttpRequest;
if (xhr) { xhr.addEventListener("readystatechange", function (e)
{if (xhr.readyState == 1 /* OPENED */) {
xhr.setRequestHeader("X-Foo", "Bar");
}})}}