语法,在中括号里填上html标签的属性名称:
<h2>Products</h2>
<div *ngFor="let product of productsJerry2">
<h3>
<a [title]="product.name + ' details'">
{{ product.name }}
</a>
</h3>
<p *ngIf="product.description">
Description: {{ product.description }}
</p>
<button (click)="share()">
Share
</button>
</div>
最后渲染出来的html源代码: