Imagine a scenario where you have a radiobutton HTML element within an angular application,
<div class="radio">
<label>
<input type="radio" name="approvedeny" value="true" [(ngModel)]=_approvedOrDenied>
Approve
</label>
</div>
Within our component, the _approvedOrDenied
property is defined as a boolean.
@Component({
export class ApprovalsComponent implements OnInit {
_approvedOrDenied: boolean;
Surprisingly, during debugging of the clientside code, it was observed that this property was being set as a string. There are no explicit casts in the code that could lead to this behavior, suggesting that Angular might be automatically converting it.
Do all databound properties get converted to strings in Angular? If so, then what purpose does specifying the type _approvedOrDenied: boolean
serve in typescript?