У меня есть файл html, определенный как:
<div class="dialogBox">
<ng-template #callAPIDialog>
<h2 mat-dialog-title class="dialogHeading">Scale Dimensions</h2>
<p>
<mat-form-field>
<mat-label>Width</mat-label>
<input matInput placeholder="Enter width (in ft)" #width name="width">
<mat-hint>Enter width in number</mat-hint>
</mat-form-field>
</p>
<p>
<mat-form-field>
<mat-label>Height</mat-label>
<input matInput placeholder="Enter height (in ft)" #height name="height">
<mat-hint>Enter height in number</mat-hint>
</mat-form-field>
</p>
<!-- <mat-dialog-actions> -->
<button mat-raised-button (click)="scaleDrop(height.value,width.value)" class="buttonConfirm">CONFIRM</button>
<button mat-raised-button (click)="closeDialogBox()" class="buttonCancel">CANCEL</button>
<!-- </mat-dialog-actions> -->
</ng-template>
</div>
В моем TS-файле я вызываю его следующим образом:
@ViewChild('callAPIDialog', { static: false }) callAPIDialog: TemplateRef<any>;
callAPI() {
............}
Однако я получаю ошибку следующим образом:
Аргумент типа { static: boolean; }
нельзя назначить параметру типа { read?: any; }
. Объектный литерал может указывать только известные свойства, а static
не существует в типе { read?: any; }
.
Как это исправить?