diff --git a/demo-shell-ng2/app/components/files/files.component.html b/demo-shell-ng2/app/components/files/files.component.html index 25b349cd8b..f4374299bf 100644 --- a/demo-shell-ng2/app/components/files/files.component.html +++ b/demo-shell-ng2/app/components/files/files.component.html @@ -1,5 +1,5 @@ - - + + = new EventEmitter(); + @Output() + folderClick: EventEmitter = new EventEmitter(); + rootFolder = { name: 'Document Library', path: 'Sites/swsdp/documentLibrary' @@ -221,6 +224,9 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit */ displayFolderContent(path) { if (path !== null) { + this.folderClick.emit({ + value: path + }); this.currentFolderPath = path; this._alfrescoService .getFolder(path) diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.d.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.d.ts index 964f98c1ad..a4802e75ae 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.d.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.d.ts @@ -17,6 +17,7 @@ import { ElementRef } from 'angular2/core'; import { FileModel } from '../models/file.model'; import { FileUploadingDialogComponent } from './file-uploading-dialog.component'; +import { TranslateService } from 'ng2-translate/ng2-translate'; /** * { return !uploadingFileModel.uploading && !uploadingFileModel.done && !uploadingFileModel.abort && !uploadingFileModel.error; }); filesToUpload.forEach((uploadingFileModel) => { uploadingFileModel.setUploading(); - this.uploadFile(uploadingFileModel); + this.uploadFile(uploadingFileModel, directory); }); }; @@ -121,18 +119,20 @@ export class UploadService { } /** - * Upload a file, and enrich it with the xhr. + * Upload a file into the directory folder, and enrich it with the xhr. * * @param {FileModel} - files to be uploaded. * */ - uploadFile(uploadingFileModel: any): void { + uploadFile(uploadingFileModel: any, directory: string): void { let form = new FormData(); form.append(this._fieldName, uploadingFileModel.file, uploadingFileModel.name); Object.keys(this._formFields).forEach((key) => { form.append(key, this._formFields[key]); }); + form.append('uploaddirectory', directory); + this._configureXMLHttpRequest(uploadingFileModel); uploadingFileModel.setXMLHttpRequest(this._xmlHttpRequest);