Angular 2: radio buttons not working -


i intend these 2 radio buttons such user can select 1 or other. both showing on form checked , cannot unchecked.

       <div class="form-group">        <label class="col-sm-12">            <input type="radio" name="paymenttype" id="paymenttype"               [(ngmodel)]="payment.paymenttype"              [value]="paypal" required>        </label>      </div>      <div class="form-group">        <label class="col-sm-12">            <input type="radio" name="paymenttype" id="paymenttype"             [(ngmodel)]="payment.paymenttype"               [value]="credit" required>          </label>      </div>

<div class="form-group">  <label class="col-sm-12">        <input type="radio" name="paymenttype"          [(ngmodel)]="payment.paymenttype"          [value]="paypal" required>  </label>  </div>    <div class="form-group">  <label class="col-sm-12">        <input type="radio" name="paymenttype"        [(ngmodel)]="payment.paymenttype"        [value]="credit" required>  </label>  </div>

remove name in both radio buttons , [checked] binding, both unchecked @ first. radios same name in radio group, when check 1 radio button other unchecked.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -