Angular 9期望有2个参数,但得到1。src / app / Registration / researchers / researchers.component.html(42,41):期望有2个参数,但得到1

时间:2020-06-10 09:14:44

标签: angular9 angular-ng-if

HTML代码段

  {{ snap.bytesTransferred | fileSize }} of {{ snap.totalBytes | fileSize }}
  <div *ngIf="downloadURL | async as url">
    <h3> Your Document is Successfully Uploaded</h3>
    <img [src]="url">
    <br>
    <a [href]="url" target="_blank" rel="noopener">Download</a>
  </div>

  <button (click)="task.pause()" class="button btn-warning" [disabled]="!isActive(snap)">Pause</button>
  <button (click)="task.cancel()" class="button btn-danger" [disabled]="!isActive(snap)">Cancel</button>
  <button (click)="task.resume()" class="button btn-info" [disabled]="!(snap?.state === 'paused')">Resume</button>

</div>```

TS Code Snippet 

快照:可观察;

//确定上载任务是否处于活动状态 isActive(快照){ 返回( snapshot.state ==='正在运行'&& snapshot.bytesTransferred <快照.totalBytes ); }

The error is occuring in the HTML File at the line ```<div *ngIf="snapshot | async  as snap ">```

And the error reads "ERROR in src/app/Registration/researchers/researchers.component.html(42,41): Expected 2 arguments, but got 1.
src/app/Registration/researchers/researchers.component.html(42,41): Expected 2 arguments, but got 1."

0 个答案:

没有答案