#129 Fixed change detector

This commit is contained in:
mauriziovitale84 2016-06-02 12:38:22 +01:00
parent 3abee3c8ac
commit e506490f81

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component } from 'angular2/core'; import { Component, ChangeDetectorRef } from 'angular2/core';
import { FileModel } from '../models/file.model'; import { FileModel } from '../models/file.model';
import { FileUploadingListComponent } from './file-uploading-list.component'; import { FileUploadingListComponent } from './file-uploading-list.component';
import { AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core'; import { AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
@ -51,13 +51,15 @@ export class FileUploadingDialogComponent {
private _isDialogMinimized: boolean = false; private _isDialogMinimized: boolean = false;
constructor(private _uploaderService: UploadService) {} constructor(private cd: ChangeDetectorRef,
private _uploaderService: UploadService) {}
ngOnInit() { ngOnInit() {
this._uploaderService.filesUpload$.subscribe((fileList: FileModel[]) => { this._uploaderService.filesUpload$.subscribe((fileList: FileModel[]) => {
this.filesUploadingList = fileList; this.filesUploadingList = fileList;
if (this.filesUploadingList.length > 0) { if (this.filesUploadingList.length > 0) {
this.isDialogActive = true; this.isDialogActive = true;
this.cd.detectChanges();
} }
}); });
} }