#46 JSDoc and doc of File upload Event onSucces

This commit is contained in:
mauriziovitale84
2016-05-20 18:12:07 +01:00
parent 293662ec4f
commit cb6b036caf
3 changed files with 23 additions and 6 deletions

View File

@@ -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)">
</alfresco-upload-button>
```
@@ -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)">
</alfresco-upload-button>`,
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<br />
#### Options
**showDialogUpload**: {boolean} optional) default true. Hide/show upload dialog.<br />
@@ -138,7 +146,7 @@ This component, provide a drag and drop are to upload files to alfresco.
#### Basic usage
```html
<alfresco-upload-drag-area [showDialogUpload]="true" ></alfresco-upload-drag-area>
<alfresco-upload-drag-area [showDialogUpload]="true" (onSuccess)="customMethod($event)"></alfresco-upload-drag-area>
```
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: `<alfresco-upload-drag-area [showDialogUpload]="true" >
template: `<alfresco-upload-drag-area [showDialogUpload]="true" (onSuccess)="customMethod($event)" >
<div style="width: 200px; height: 100px; border: 1px solid #888888">
DRAG HERE
</div>
@@ -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<br />
#### Options
**showDialogUpload**: {boolean} optional) default true. Hide/show upload dialog.<br />