28
loading...
This website collects cookies to deliver better user experience
{{
and }}
to encapsulates the expression.<p>{{title}}</p>
<div><img src="{{itemImageUrl}}"></div>
[]
brackets cause Angular to consider right-hand side value as dynamic, without brackets Angular evaluates the right-hand value as static string.<img [src]="itemImageUrl">
<app-item-detail childItem="parentItem"></app-item-detail>
<button [attr.aria-label]="actionName">{{actionName}} with Aria</button>
[class.sale]="onSale"
[class]="'my-class-1 my-class-2 my-class-3'"
<nav [style.background-color]="expression"></nav>
<nav [style]="stylesExpression"></nav>
<app-button>
component template using custom event showMessage()
:[]
and parentheses ()
. [()]
refers to property binding followed by event binding.<app-sizer [(size)]="fontSize"></app-sizer>