diff --git a/ng2-components/ng2-alfresco-upload/README.md b/ng2-components/ng2-alfresco-upload/README.md
index cc4a370b9d..4a75fec9de 100644
--- a/ng2-components/ng2-alfresco-upload/README.md
+++ b/ng2-components/ng2-alfresco-upload/README.md
@@ -86,7 +86,8 @@ Make sure your systemjs.config has the following configuration:
[showUdoNotificationBar]="true"
[uploadFolders]="true"
[multipleFiles]="false"
- [acceptedFilesType]=".jpg,.gif,.png,.svg">
+ [acceptedFilesType]=".jpg,.gif,.png,.svg"
+ (onSuccess)="customMethod($event)">
```
@@ -106,7 +107,8 @@ import { ALFRESCO_ULPOAD_COMPONENT, UploadService } from 'ng2-alfresco-upload/ng
[showUdoNotificationBar]="true"
[uploadFolders]="true"
[multipleFiles]="false"
- [acceptedFilesType]=".jpg,.gif,.png,.svg">
+ [acceptedFilesType]=".jpg,.gif,.png,.svg"
+ (onSuccess)="customMethod($event)">
`,
directives: [ALFRESCO_ULPOAD_COMPONENT]
})
@@ -114,6 +116,9 @@ export class MyDemoApp {
constructor(alfrescoSettingsService: AlfrescoSettingsService) {
alfrescoSettingsService.host = 'http://myalfrescoip';
}
+ customMethod(event: Object) {
+ console.log('File uploaded');
+ }
}
bootstrap(MyDemoApp, [
@@ -124,6 +129,9 @@ bootstrap(MyDemoApp, [
UploadService
]);
```
+#### Events
+**onSuccess**: The event is emitted when the file is uploaded
+
#### Options
**showDialogUpload**: {boolean} optional) default true. Hide/show upload dialog.
@@ -138,7 +146,7 @@ This component, provide a drag and drop are to upload files to alfresco.
#### Basic usage
```html
-
+
```
Example of an App that declares upload drag and drop component :
@@ -153,7 +161,7 @@ import { ALFRESCO_ULPOAD_COMPONENT, UploadService } from 'ng2-alfresco-upload/ng
@Component({
selector: 'my-app',
- template: `
+ template: `
DRAG HERE
@@ -164,6 +172,9 @@ export class MyDemoApp {
constructor(alfrescoSettingsService: AlfrescoSettingsService) {
alfrescoSettingsService.host = 'http://myalfrescoip';
}
+ customMethod(event: Object) {
+ console.log('File uploaded');
+ }
}
bootstrap(MyDemoApp, [
@@ -174,6 +185,9 @@ bootstrap(MyDemoApp, [
UploadService
]);
```
+#### Events
+**onSuccess**: The event is emitted when the file is uploaded
+
#### Options
**showDialogUpload**: {boolean} optional) default true. Hide/show upload dialog.
diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts
index c91ab02f36..6c2813b01c 100644
--- a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts
+++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts
@@ -31,7 +31,8 @@ declare let __moduleName: string;
* [showUdoNotificationBar]="boolean"
* [uploadFolders]="boolean"
* [multipleFiles]="boolean"
- * [acceptedFilesType]="string">
+ * [acceptedFilesType]="string"
+ * (onSuccess)="customMethod($event)">
*
*
* This component, provide a set of buttons to upload files to alfresco.
@@ -42,6 +43,7 @@ declare let __moduleName: string;
* @InputParam {boolean} [false] multipleFiles - allow/disallow multiple files.
* @InputParam {string} [*] acceptedFilesType - array of allowed file extensions.
*
+ * @Output - onSuccess - The event is emitted when the file is uploaded
*
* @returns {UploadDragAreaComponent} .
*/
diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts
index 837e02aa08..b2038c5b15 100644
--- a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts
+++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts
@@ -24,12 +24,13 @@ import { FileDraggableDirective } from '../directives/file-draggable.directive';
declare let __moduleName: string;
/**
- *
+ *
*
* This component, provide a drag and drop are to upload files to alfresco.
*
* @InputParam {boolean} [true] showDialogUpload - hide/show upload dialog .
*
+ * @Output - onSuccess - The event is emitted when the file is uploaded
*
* @returns {UploadDragAreaComponent} .
*/