Пользовательский интерфейс Kendo в прогрессивной строке Angular не работает во всплывающем окне - PullRequest
0 голосов
/ 20 февраля 2020

Я пытаюсь загрузить файл с помощью Kendo UI в angular. Все работает нормально, кроме индикатора выполнения. Он всегда показывает ноль при загрузке. Я использую Kedno UI upload во всплывающем окне.

Вот мой родительский компонент parent.component.html

<button kendoButton [primary]="true" (click)="uploadMe(id)">
<app-upload [model]="uploadItem" (cancel)="uploadcancelHandler()"> </app-upload>

parent.component.ts

 public uploadMe (id) {
    this.uploadItem = {
      id: id
    };
  }

upload.component. html

<kendo-upload
      [saveUrl]="saveUrl"
      #dUpload
      [(ngModel)]="myFiles"
      [autoUpload]="false"
      [restrictions]="myRestrictions"
      [withCredentials]="false"
      [disabled]="disme"
      (clear)="clearEventHandler($event)"
      (success)="successEventHandler($event)"
      (upload)="uploadEventHandler($event)"
      (error)="errorEventHandler($event)"
      (select)="selectEventHandler($event)">
 </kendo-upload>

upload.component.ts

saveUrl = "saveUrl";
selectEventHandler(e: SelectEvent) {}
uploadEventHandler(e: UploadEvent) {
}
successEventHandler(e: SuccessEvent) {
}
clearEventHandler(e: ClearEvent) {}

errorEventHandler(e: ErrorEvent) {}

interceptor.ts

intercept (
req: HttpRequest<any>,
next: HttpHandler
): Observable<HttpEvent<any>> {
if (req.url === "saveUrl") {
    const headers = new HttpHeaders({ "Content-Type": this.store.content });
    const req = new HttpRequest(
    "PUT",
    this.store.fileurl,
    this.store.actualfile,
    {
        headers: headers,
        reportProgress: true
    }
    );
    return next.handle(req).pipe(
    map((event: HttpEvent<any>) => {
        if (event instanceof HttpResponse) {
        }
        return event;
    }),
    catchError((error: HttpErrorResponse) => {
        return throwError(error);
    })
    );
}

Всплывающая секция загрузки. Загрузка файла прошла успешно, но панель прогессов всегда была нулевой и не показывала количество прогестерсов. Заранее спасибо.

...