#46 Updated doc

This commit is contained in:
mauriziovitale84
2016-06-02 12:34:47 +01:00
parent cedddf47fc
commit 3abee3c8ac
4 changed files with 21 additions and 27 deletions

View File

@@ -86,8 +86,7 @@ npm install --save material-design-icons material-design-lite
```html
<alfresco-upload-button [showDialogUpload]="true"
[showUdoNotificationBar]="true"
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="true"
[multipleFiles]="false"
[acceptedFilesType]=".jpg,.gif,.png,.svg"
@@ -107,8 +106,7 @@ import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/d
@Component({
selector: 'my-app',
template: `<alfresco-upload-button [showDialogUpload]="true"
[showUdoNotificationBar]="true"
template: `<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="true"
[multipleFiles]="false"
[acceptedFilesType]=".jpg,.gif,.png,.svg"
@@ -139,7 +137,6 @@ bootstrap(MyDemoApp, [
#### Options
**showDialogUpload**: {boolean} optional) default true. Hide/show upload dialog.<br />
**showUdoNotificationBar**: {boolean} (optional) default true. Hide/show notification bar.<br />
**uploadFolders**: {boolean} (optional) default false. Allow/disallow upload folders (only for chrome).<br />
**multipleFiles**: {boolean} (optional) default false. Allow/disallow multiple files.<br />
@@ -151,7 +148,7 @@ This component, provide a drag and drop are to upload files to alfresco.
#### Basic usage
```html
<alfresco-upload-drag-area [showDialogUpload]="true" (onSuccess)="customMethod($event)"></alfresco-upload-drag-area>
<alfresco-upload-drag-area (onSuccess)="customMethod($event)"></alfresco-upload-drag-area>
```
Example of an App that declares upload drag and drop component :
@@ -166,7 +163,7 @@ import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/d
@Component({
selector: 'my-app',
template: `<alfresco-upload-drag-area [showDialogUpload]="true" (onSuccess)="customMethod($event)" >
template: `<alfresco-upload-drag-area (onSuccess)="customMethod($event)" >
<div style="width: 200px; height: 100px; border: 1px solid #888888">
DRAG HERE
</div>
@@ -194,9 +191,16 @@ bootstrap(MyDemoApp, [
#### Events
**onSuccess**: The event is emitted when the file is uploaded<br />
#### Options
### Files Dialog
This component provides a dialog that shows all the files uploaded
with upload button or drag & drop area components. This component should
be used in combination with upload button or drag & drop area.
**showDialogUpload**: {boolean} optional) default true. Hide/show upload dialog.<br />
#### Basic usage
```html
<file-uploading-dialog></file-uploading-dialog>
```
## Build from sources
Alternatively you can build component from sources with the following commands:

View File

@@ -26,8 +26,7 @@ import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/d
selector: 'my-app',
template: `<label for="token">Access Token</label><br>
<input id="token" type="text" size="48" (change)="updateToken()" [(ngModel)]="token"><br><br>
<alfresco-upload-button [showDialogUpload]="true"
[showUdoNotificationBar]="true"
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="false"
[multipleFiles]="false"
(onSuccess)="customMethod($event)">
@@ -35,8 +34,7 @@ import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/d
<br><br>
<alfresco-upload-button [showDialogUpload]="true"
[showUdoNotificationBar]="true"
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="true"
[multipleFiles]="false"
(onSuccess)="customMethod($event)">
@@ -44,8 +42,7 @@ import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/d
<br><br>
<alfresco-upload-button [showDialogUpload]="true"
[showUdoNotificationBar]="true"
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="false"
[multipleFiles]="true"
(onSuccess)="customMethod($event)">
@@ -53,11 +50,12 @@ import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/d
<br><br>
<alfresco-upload-drag-area [showDialogUpload]="true" (onSuccess)="customMethod($event)" >
<alfresco-upload-drag-area (onSuccess)="customMethod($event)" >
<div style="width: 200px; height: 100px; border: 1px solid #888888">
DRAG HERE
</div>
</alfresco-upload-drag-area>`,
</alfresco-upload-drag-area>
<file-uploading-dialog></file-uploading-dialog>`,
directives: [ALFRESCO_ULPOAD_COMPONENTS]
})
export class MyDemoApp {

View File

@@ -18,7 +18,6 @@
import { Component, ViewChild, ElementRef, Input, Output, EventEmitter } from 'angular2/core';
import { UploadService } from '../services/upload.service';
import { FileModel } from '../models/file.model';
import { AlfrescoTranslationService, AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import 'rxjs/Rx';
@@ -26,8 +25,7 @@ declare let componentHandler: any;
declare let __moduleName: string;
/**
* <alfresco-upload-button [showDialogUpload]="boolean"
* [showUdoNotificationBar]="boolean"
* <alfresco-upload-button [showUdoNotificationBar]="boolean"
* [uploadFolders]="boolean"
* [multipleFiles]="boolean"
* [acceptedFilesType]="string"
@@ -36,7 +34,6 @@ declare let __moduleName: string;
*
* This component, provide a set of buttons to upload files to alfresco.
*
* @InputParam {boolean} [true] showDialogUpload - hide/show upload dialog.
* @InputParam {boolean} [true] showUdoNotificationBar - hide/show notification bar.
* @InputParam {boolean} [false] uploadFolders - allow/disallow upload folders (only for chrome).
* @InputParam {boolean} [false] multipleFiles - allow/disallow multiple files.
@@ -58,9 +55,6 @@ export class UploadButtonComponent {
@ViewChild('undoNotificationBar')
undoNotificationBar: any;
@Input()
showUploadDialog: boolean = true;
@Input()
showUdoNotificationBar: boolean = true;

View File

@@ -22,12 +22,10 @@ import { FileDraggableDirective } from '../directives/file-draggable.directive';
declare let __moduleName: string;
/**
* <alfresco-upload-drag-area [showDialogUpload]="boolean" (onSuccess)="customMethod($event)></alfresco-upload-drag-area>
* <alfresco-upload-drag-area (onSuccess)="customMethod($event)></alfresco-upload-drag-area>
*
* 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} .