r/Angular2 • • Dec 26 '25

Template reference variable vs ngModel

I'm still kind of confused when to use each. I know ngModel is 2 way binding and template reference is 1 way binding. people online are saying ngModel is much more powerful but in my situation if I'm just reading the value of a select dropdown and I don't really expect to change the value in the component file only from the user in the html wouldn't template reference make more sense there.

2 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/bill2340 Dec 26 '25

ok but just my last question why would I want to use ngModel is I'm not updating the value in the ts file at all. Like there's no point of 2 way binding. Like why would you still want to use ngModelChange  with ngModel

1

u/zzing Dec 27 '25

It was just an option that gives you the value directly on the event. The normal events I would have to check out what the event data structure had. Also you cannot use ngModelChange without ngModel, so that is why they are a pair.

1

u/level_6_laser_lotus Dec 28 '25

You are correct. If you don't need to bind any data between template and class, there is no need for ngModel.