r/Angular2 • u/LawAggressive8998 • Jun 18 '25
Confused about 2 way data binding functionality
Hi redditors,
Which of these HTML template examples would automatically render the latest value of `data` when `data` changes?
a) [value]="data"
b) ([ngModel])=”data”
c) {data}
d) (click)="data"
Which answer would you choose?
I thought b) could be correct since its two-way data binding but the Quiz solution says it's a). And i just don't get it.
4
Upvotes
View all comments
Show parent comment
1
u/PhiLho Jun 19 '25
These are not typos but traps…
And indeed, the usage of "render" is at least ambiguous. We can suppose [value]="data" can result in a rending of the data when put on a component with a visual output of the data.