$scope.downLoad = function (id) {
var url = UrDownFile + "?fileId=" + id;
var pp = angular.element(this).parent();
var index = pp.prevObject[0].$index;
var fileName = $scope.ownerFile[index].fileName;
downloadFile(url,fileName,$http)
};
function downloadFile(url,fileName,type) {
type.get(url,{responseType: "blob"}).success(function (data) {
var blob = new Blob([data], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});
var a = document.createElement("a");
document.body.appendChild(a);
a.download = fileName;
a.href = window.URL.createObjectURL(blob);
a.click();
})
}