Angular 2,重置单选按钮值

时间:2017-07-04 21:21:26

标签: html angular typescript

我可以通过什么方式让它从联系中消失,

过程是:

选择"是 - 第三"然后选择put值2或3 然后

联系人div将显示一个单选按钮

但是,如果我然后选择" no"在div的第一组单选按钮" number"," contact"带有单选按钮的div应该消失



<div class="row">
  <div class="small-12 columns">
    <md-card>
      <md-card-content>
        <div class="row">
          <div class="small-3 columns">
            <div class="row">
              <div class="small-6 columns">
                <span class="subtitle">Number</span>
                <span>3333333333</span>
              </div>
              <div class="small-6 columns">
                <span class="subtitle">Contact</span>
                <md-radio-group class="radio-vertical" [(ngModel)]="valorRadio">
                  <md-radio-button value="0">Yes</md-radio-button>
                  <md-radio-button value="1">No</md-radio-button>
                  <md-radio-button value="2">Yes-third</md-radio-button>
                </md-radio-group>
              </div>
            </div>
            <div class="small-12 columns">
              <md-select *ngIf="valorRadio == 1" placeholder="Causal" class="select_100">
                <md-option value="0">No</md-option>
                <md-option value="1">Yes</md-option>
              </md-select><br>
              <md-select *ngIf="valorRadio == 2" placeholder="No Contact" [(ngModel)]="valorOpcion" class="select_100">
                <md-option value="0">value 0</md-option>
                <md-option value="1">value 1</md-option>
                <md-option value="2">value 2</md-option>
                <md-option value="3">value 3</md-option>
              </md-select>
            </div>
          </div>
          <br><br><br>
          <div *ngIf="valorOpcion == 3 || valorOpcion == 2">
            <div class="small-6 columns">
              <div class="row">
                <div class="small-6 columns">
                  <span>Contact</span>
                  <md-radio-group (change)="opcionSeleccionada" [(ngModel)]="valorRadio2" class="radio-vertical">
                    <md-radio-button value="0">Sí</md-radio-button>
                    <md-radio-button value="1">No</md-radio-button>
                  </md-radio-group>
                </div>
              </div>
              <div *ngIf="valorRadio2 == 1" class="small-6 columns">
                <md-select class="select_100" placeholder="Causal">
                  <md-option value="0">No</md-option>
                  <md-option value="1">Yes</md-option>
                </md-select>
              </div>
            </div>
          </div>
        </div>
      </md-card-content>
    </md-card>
  </div>
</div>
&#13;
&#13;
&#13;

这是plunker http://plnkr.co/edit/sm5yEir9Lq0ZWiJ9yoZF?p=preview

中的代码

非常感谢您的帮助

0 个答案:

没有答案