I wonder when do I have to use [(ngModel)] on my input and when I can just use #reference For example
<div class="form-group">
<div class="input-group mb-2">
<input type="text" class="form-control" [(ngModel)]="newUser">
<button class="btn btn-outline-success" (click)="onAddUser()">Add user</button>
</div>
</div>
Should I do it this way here, or maybe I can do it this way instead:
<div class="form-group">
<div class="input-group mb-2">
<input type="text" class="form-control" #newUser>
<button class="btn btn-outline-success" (click)="onAddUser(newUser.value)">
Add user
</button>
</div>
</div>
I would be thankful for any answers)