mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#46 JSDoc and doc of File upload Event onSucces
This commit is contained in:
@@ -86,7 +86,8 @@ Make sure your systemjs.config has the following configuration:
|
|||||||
[showUdoNotificationBar]="true"
|
[showUdoNotificationBar]="true"
|
||||||
[uploadFolders]="true"
|
[uploadFolders]="true"
|
||||||
[multipleFiles]="false"
|
[multipleFiles]="false"
|
||||||
[acceptedFilesType]=".jpg,.gif,.png,.svg">
|
[acceptedFilesType]=".jpg,.gif,.png,.svg"
|
||||||
|
(onSuccess)="customMethod($event)">
|
||||||
</alfresco-upload-button>
|
</alfresco-upload-button>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -106,7 +107,8 @@ import { ALFRESCO_ULPOAD_COMPONENT, UploadService } from 'ng2-alfresco-upload/ng
|
|||||||
[showUdoNotificationBar]="true"
|
[showUdoNotificationBar]="true"
|
||||||
[uploadFolders]="true"
|
[uploadFolders]="true"
|
||||||
[multipleFiles]="false"
|
[multipleFiles]="false"
|
||||||
[acceptedFilesType]=".jpg,.gif,.png,.svg">
|
[acceptedFilesType]=".jpg,.gif,.png,.svg"
|
||||||
|
(onSuccess)="customMethod($event)">
|
||||||
</alfresco-upload-button>`,
|
</alfresco-upload-button>`,
|
||||||
directives: [ALFRESCO_ULPOAD_COMPONENT]
|
directives: [ALFRESCO_ULPOAD_COMPONENT]
|
||||||
})
|
})
|
||||||
@@ -114,6 +116,9 @@ export class MyDemoApp {
|
|||||||
constructor(alfrescoSettingsService: AlfrescoSettingsService) {
|
constructor(alfrescoSettingsService: AlfrescoSettingsService) {
|
||||||
alfrescoSettingsService.host = 'http://myalfrescoip';
|
alfrescoSettingsService.host = 'http://myalfrescoip';
|
||||||
}
|
}
|
||||||
|
customMethod(event: Object) {
|
||||||
|
console.log('File uploaded');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bootstrap(MyDemoApp, [
|
bootstrap(MyDemoApp, [
|
||||||
@@ -124,6 +129,9 @@ bootstrap(MyDemoApp, [
|
|||||||
UploadService
|
UploadService
|
||||||
]);
|
]);
|
||||||
```
|
```
|
||||||
|
#### Events
|
||||||
|
**onSuccess**: The event is emitted when the file is uploaded<br />
|
||||||
|
|
||||||
#### Options
|
#### Options
|
||||||
|
|
||||||
**showDialogUpload**: {boolean} optional) default true. Hide/show upload dialog.<br />
|
**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
|
#### Basic usage
|
||||||
|
|
||||||
```html
|
```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 :
|
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({
|
@Component({
|
||||||
selector: 'my-app',
|
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">
|
<div style="width: 200px; height: 100px; border: 1px solid #888888">
|
||||||
DRAG HERE
|
DRAG HERE
|
||||||
</div>
|
</div>
|
||||||
@@ -164,6 +172,9 @@ export class MyDemoApp {
|
|||||||
constructor(alfrescoSettingsService: AlfrescoSettingsService) {
|
constructor(alfrescoSettingsService: AlfrescoSettingsService) {
|
||||||
alfrescoSettingsService.host = 'http://myalfrescoip';
|
alfrescoSettingsService.host = 'http://myalfrescoip';
|
||||||
}
|
}
|
||||||
|
customMethod(event: Object) {
|
||||||
|
console.log('File uploaded');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bootstrap(MyDemoApp, [
|
bootstrap(MyDemoApp, [
|
||||||
@@ -174,6 +185,9 @@ bootstrap(MyDemoApp, [
|
|||||||
UploadService
|
UploadService
|
||||||
]);
|
]);
|
||||||
```
|
```
|
||||||
|
#### Events
|
||||||
|
**onSuccess**: The event is emitted when the file is uploaded<br />
|
||||||
|
|
||||||
#### Options
|
#### Options
|
||||||
|
|
||||||
**showDialogUpload**: {boolean} optional) default true. Hide/show upload dialog.<br />
|
**showDialogUpload**: {boolean} optional) default true. Hide/show upload dialog.<br />
|
||||||
|
@@ -31,7 +31,8 @@ declare let __moduleName: string;
|
|||||||
* [showUdoNotificationBar]="boolean"
|
* [showUdoNotificationBar]="boolean"
|
||||||
* [uploadFolders]="boolean"
|
* [uploadFolders]="boolean"
|
||||||
* [multipleFiles]="boolean"
|
* [multipleFiles]="boolean"
|
||||||
* [acceptedFilesType]="string">
|
* [acceptedFilesType]="string"
|
||||||
|
* (onSuccess)="customMethod($event)">
|
||||||
* </alfresco-upload-button>
|
* </alfresco-upload-button>
|
||||||
*
|
*
|
||||||
* This component, provide a set of buttons to upload files to alfresco.
|
* 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 {boolean} [false] multipleFiles - allow/disallow multiple files.
|
||||||
* @InputParam {string} [*] acceptedFilesType - array of allowed file extensions.
|
* @InputParam {string} [*] acceptedFilesType - array of allowed file extensions.
|
||||||
*
|
*
|
||||||
|
* @Output - onSuccess - The event is emitted when the file is uploaded
|
||||||
*
|
*
|
||||||
* @returns {UploadDragAreaComponent} .
|
* @returns {UploadDragAreaComponent} .
|
||||||
*/
|
*/
|
||||||
|
@@ -24,12 +24,13 @@ import { FileDraggableDirective } from '../directives/file-draggable.directive';
|
|||||||
declare let __moduleName: string;
|
declare let __moduleName: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <alfresco-upload-drag-area [showDialogUpload]="boolean" ></alfresco-upload-drag-area>
|
* <alfresco-upload-drag-area [showDialogUpload]="boolean" (onSuccess)="customMethod($event)></alfresco-upload-drag-area>
|
||||||
*
|
*
|
||||||
* This component, provide a drag and drop are to upload files to alfresco.
|
* This component, provide a drag and drop are to upload files to alfresco.
|
||||||
*
|
*
|
||||||
* @InputParam {boolean} [true] showDialogUpload - hide/show upload dialog .
|
* @InputParam {boolean} [true] showDialogUpload - hide/show upload dialog .
|
||||||
*
|
*
|
||||||
|
* @Output - onSuccess - The event is emitted when the file is uploaded
|
||||||
*
|
*
|
||||||
* @returns {UploadDragAreaComponent} .
|
* @returns {UploadDragAreaComponent} .
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user