-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Migrate from 0.x.x to 1.x.x
hoeni edited this page Sep 12, 2014
·
5 revisions
-
ng-file-select
->nv-file-select
-
ng-file-drop
->nv-file-drop
-
ng-file-over
->nv-file-over
$fileUploader
-> FileUploader
FileUploader
is now an angular factory meaning the syntax for creating an uploader has changed:
var uploader = $fileUploader.create(); // BEFORE
var uploader = new FileUploader(); // NOW
<element nv-file-drop uploader="{Object}" options="{Object}" filters="{String}"></element>
<element nv-file-select uploader="{Object}" options="{Object}" filters="{String}"></element>
<element nv-file-over uploader="{Object}" over-class="{String}"></element>
uploader.filters.push({
name: 'filterName',
fn: function(item /*{File|FileLikeObject}*/, options) {
// ...
}
});
// --------------------
uploader.bind('afteraddingfile', function(event, item) {}); // EARLY
uploader.onAfterAddingFile = function(item) {}; // NOW
// --------------------
uploader.bind('afteraddingall', function(event, item) {});
uploader.onAfterAddingAll = function(item) {};
// --------------------
uploader.bind('whenaddingfilefailed', function(event, item) {});
uploader.onWhenAddingFileFailed = function(item /*{File|FileLikeObject}*/, filter, options) {};
// --------------------
uploader.bind('beforeupload', function(event, item) {});
uploader.onBeforeUploadItem = function(item) {};
// --------------------
uploader.bind('progress', function(event, item, progress) {});
uploader.onProgressItem = function(item, progress) {};
// --------------------
uploader.bind('progressall', function(event, progress) {});
uploader.onProgressAll = function(progress) {};
// --------------------
uploader.bind('success', function(event, xhr, item, response) {});
uploader.onSuccessItem = function(item, response, status, headers) {};
// --------------------
uploader.bind('error', function(event, xhr, item, response) {});
uploader.onErrorItem = function(item, response, status, headers) {};
// --------------------
uploader.bind('cancel', function(event, xhr, item, response) {});
uploader.onCancelItem = function(item, response, status, headers) {};
// --------------------
uploader.bind('complete', function(event, xhr, item, response) {});
uploader.onCompleteItem = function(item, response, status, headers) {};
// --------------------
uploader.bind('completeall', function(event) {});
uploader.onCompleteAll = function() {};
// --------------------
// --------------------
ng-file-over {...};
nv-file-over {...};
// --------------------