无法使用组件 @ncstate/sat-popover 绑定到属性“satPopoverAnchorFor”

Fre*_*red 6 popover angular-material angular

抱歉这个基本问题。我是 Angular 项目的新手。

我想将组件 @ncstate/sat-popover 与 Angular 材料表一起使用。目的是对表格行中的字段进行内联编辑。我从 stackblitz 的这个例子中获得灵感。 https://stackblitz.com/edit/inline-edit-mat-table?file=app%2Fapp.component.html

我使用它的方式示例:

    <mat-cell *matCellDef="let row" [satPopoverAnchorFor]="p" (click)="p.open()">
      <ng-container *ngIf="row.consumption_id">
        {{row.consumption_id}}
      </ng-container>

      <span class="add-consumption_id" *ngIf="!row.consumption_id">
        Add a consumption id.
      </span>

      <sat-popover #p
          hasBackdrop
          xAlign="start"
          yAlign="start"
          (closed)="update(row, $event)">
        <inline-edit [value]="row.consumption_id"></inline-edit>
      </sat-popover>
    </mat-cell>

Run Code Online (Sandbox Code Playgroud)

我收到错误:

SCRIPT5022: Template parse errors:
**Can't bind to 'satPopoverAnchorFor' since it isn't a known property of 'mat-cell'.**
1. If 'mat-cell' is an Angular component and it has 'satPopoverAnchorFor' input, then verify that it is part of this module.
...
Run Code Online (Sandbox Code Playgroud)

我用不同版本的 Angular(8.0.0 和 8.1.0)重新创建了这个项目 2 次

在我的项目中,一切看起来都已正确安装和导入。

知道我错过了什么吗?

谢谢你,弗雷德

kev*_*inc 11

在最新版本中,属性从 [satPopoverAnchorFor] 更改为 [satPopoverAnchor]。

 <td mat-cell *matCellDef="let product" [satPopoverAnchor]="p" (click)="p.open()">  {{product.case_height}}
        <sat-popover #p
        hasBackdrop
        xAlign="start"
        yAlign="start"
        (closed)="updateProduct(product,'case_height', $event)">

               <inline-edit [sku]="product.case_height" [fieldname]="'Case Height'" [fieldvalue]="product.case_height"></inline-edit>
        </sat-popover>


 </td>
Run Code Online (Sandbox Code Playgroud)


chi*_*iya 1

尝试这个<mat-cell *matCellDef="let row" satPopoverAnchorFor="p" (click)="p.open()">