【发布时间】:2019-12-13 03:05:54
【问题描述】:
在角度教程中有这个例子:
<h3>
<a [title]="product.name + ' details'">
{{ product.name }}
</a>
</h3>
如果我这样写,效果会很好:
<h3>
<a title="{{product.name + ' details'}}">
{{ product.name }}
</a>
</h3>
有什么区别?最佳做法是什么?
【问题讨论】:
-
但插值的工作方式与属性绑定完全相同。
标签: javascript angular typescript single-page-application angular8