html - Angular2- Object as Radio Input Value -
is possible bind json object radio input in angular2?
i have json object named object
, tried
<input type="radio" [(ngmodel)]="selectedobject" [ngvalue]="object">
but gives ngvalue not known property of input
error. tried
<input type="radio" [(ngmodel)]="selectedobject" value="{{object}}">
but selectedobject
becomes [object object]
.
i wrote code in angular 1, without testing converted angular 2 you
<span *ngfor="let list in object.lists"> <input type="radio" name="{{list.id}}" value="{{list.value}}"> </span>
Comments
Post a Comment