不能使用垫网格列表错误圆顶感知:无法在"元素"上执行"setAttribute":"","不是有效的属性名称


<mat-grid-list cols="3", rowHeight="4:3" >
<mat-grid-tile *ngFor="let itemCard of itemCards">

<!--<ul>-->
<!--  <li *ngFor="let itemCard of itemCards">-->
<mat-card class="card">
<mat-card-header>
<div mat-card-avatar class=""></div>
<mat-card-title>
{{itemCard.brand}}
</mat-card-title>
<img mat-card-avatar src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Photo of a Shiba Inu">
<mat-card-subtitle>
{{itemCard.model}}
</mat-card-subtitle>
</mat-card-header>
<img mat-card-image src="" alt="Photo of a Shiba Inu">
<mat-card-content>
<p>
{{itemCards}}
{{itemCard.descriere}}
</p>
<div>Price {{itemCard.price}}</div>
<div>Size {{itemCard.size}}</div>
</mat-card-content>
<mat-card-actions>
<button mat-button>Add to Cart</button>
<!--    <button mat-button>Favorites</button>-->
</mat-card-actions>
</mat-card>
<!--  </li>-->
<!--</ul>-->
</mat-grid-tile>
</mat-grid-list>

你好,我创建了一个垫子-卡片模板,我试图从后端显示数据到一个垫子-网格列表与卡片,你可以看到从上面的代码,我得到这个错误:"主要。ts:11错误DOMException:在'Element'上执行'setAttribute'失败:','不是一个有效的属性名。"我不知道如何修理这个,请帮助我。我提到,我尝试完全相同的事情,但我使用

  • ,你可以看到在代码中注释,它的工作,但与网格列表不。
  • 属性之间有逗号

    <mat-grid-list cols="3", rowHeight="4:3" >
    // should be
    <mat-grid-list cols="3" rowHeight="4:3" >
    

    相关内容