angular - Radio button for boolean property -


i have simple boolean property valid in object document , need bind radio-inputs.

this have far:

<input type="radio" name="valid" id="validtrue" (click)="document.valid = true" [checked]="document.valid"/> <input type="radio" name="valid" id="validfalse" (click)="document.valid = false" [checked]="!document.valid"/> 

at least setting property on click works state no displayed radio-inputs. looking in developer console of browser found out property ng-reflect-checked set doesnt seem have impact on html radio-input.

what doing wrong?
have working "angular2-boolean-radio-input" snippet?

in new forms module might want

  <input type="radio" name="food" [(ngmodel)]="document.valid" [value]="true">   <input type="radio" name="food" [(ngmodel)]="document.valid" [value]="false"> 

see design doc new forms module


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

android - CoordinatorLayout, FAB and container layout conflict -