I know about this:
<input type="text" #inp>
<button type="button" (click)="onClick(inp.value)">Click</button>
So I get the value I typed into textbox without having to use ngModel directive.
Is there any similar approach to work with radio buttons without having to use ngModel?
<input type="radio" value="selected" name="viewType">Selected
<input type="radio" value="unselected" name="viewType">Unselected
<input type="radio" value="both" name="viewType">Both
Below these radio buttons I have a refresh button like this:
<button (click)="refreshView()">Refresh</button>
These html input elements aren't part of any form tag. What I want is to have a "refreshView" function call with a parameter - the selected radio button value.
Is this possible?
ngModel. Is there a reason for not using it?