Reputation: 105439
I have a custom my-table
with the property row
bound to the host component. I can put html in two ways:
<my-table [rows]="displayEntriesCount"></my-table>
and like this:
<my-table rows="{{displayEntriesCount}}"></my-table>
what's the difference?
Upvotes: 2
Views: 44
Reputation: 657008
<my-table [rows]="displayEntriesCount"></my-table>
binds the value in displayEntriesCount
as is
<my-table rows="{{displayEntriesCount}}"></my-table>
does string interpolation. This means the assigned value is the stringified value of displayEntriesCount
.
Don't use this if you want to assign object values.
Upvotes: 2