Angular 2/4:设置一个单选按钮选中defauk

时间:2017-07-10 11:56:44

标签: angular radio-button

我使用角度为4的单选按钮,但我默认情况下无法检查一个按钮和

我的HTML:

<div>
                <span class="spanLabel"> 
                    <input class="option-input radio" type="radio" [(ngModel)]="filterQa" [value]="ALL" name="filterQa" /> ALL
                </span>
                <span class="spanLabel"> 
                    <input class="option-input radio" type="radio" [(ngModel)]="filterQa" [value]="IN" name="filterQa" /> INE
                </span>
                <span class="spanLabel">
                    <input class="option-input radio" type="radio" [(ngModel)]="filterQa" [value]="OUT" name="filterQa" /> OUTE
                </span>
                <span class="spanLabel"> 
                    <input class="option-input radio"   type="radio" [(ngModel)]="filterQ" [value]="Fermes" name="filterQ" /> TRED
                </span> 
                <span class="spanLabel"> 
                    <input class="option-input radio"   type="radio" [(ngModel)]="filterQ" [value]="Brouillon" name="filterQ" /> OUTESSS
                </span>
            </div>

在我的comonent.ts

export class FoldersComponent implements OnInit {

  public filterQa;
  public filterQ;

..
}

默认情况下如何检查TRED和ALL?

0 个答案:

没有答案