Update angular-file-upload definitions

Add abort and xhr methods to the upload promise
This commit is contained in:
Dominic Alie
2015-05-26 15:44:24 -04:00
parent f23cd55e31
commit 4ed4731d6b
2 changed files with 6 additions and 1 deletions
@@ -29,6 +29,10 @@ module controllers {
},
file: file
})
.abort()
.xhr((evt: any) => {
console.log('xhr');
})
.progress((evt: angular.angularFileUpload.IFileProgressEvent) => {
var percent = parseInt((100.0 * evt.loaded / evt.total).toString(), 10);
console.log("upload progress: " + percent + "% for " + evt.config.file.name);
+2 -1
View File
@@ -14,8 +14,9 @@ declare module angular.angularFileUpload {
}
interface IUploadPromise<T> extends IHttpPromise<T> {
abort(): IUploadPromise<T>;
progress(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
xhr(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
}
interface IFileUploadConfig extends IRequestConfig {