angular - 在textarea中编辑raddiobutton值

时间:2016-11-17 16:49:34

标签: javascript angularjs angular-ui-bootstrap

我希望popover能够检索textarea中行中的radiobuttons值,并在保存后进行必要的更改。

enter image description here

<div ng-repeat="controle in dataform.controles" ng-switch on="controle.tipo">   

  <div ng-switch-when="radio" class="kahiar-block">   

    <div id="cmp_{{controle.codcontrole}}" class="campos form-group disabled col-md-6 animated bounceInRight " ng-controller="ControlEditCtrl" popover-placement="top" uib-popover-template="dynamicPopover.templateUrl" popover-title="Editar Controle">  
      <div class="conteudo-campo">    
        <label data-id="lbl{{controle.codcontrole}}" class="label-titulo"></label>
        <div class="input-group">
          <label class="checkbox-inline" id="div_{{$index}}" ng-repeat="item in controle.opcoes track by $index" name="{{item.codcontrole}}">          
            <input id="radio_{{$index}}" icheck type="radio"  ng-value="item" ng-model="$parent.dataform[controle.nome]">
            {{item}}
          </label>        
        </div>
      </div>
    </div>

  </div>

</div>



 <script type="text/ng-template" id="myPopoverTemplate.html">
  <div class="form-group">        
    <label>Opções</label>
    <textarea  ng-model="controle.opcoes" class="form-control">
      {{controle.opcoes.join("\n").trim()}}
    </textarea>
  </div>
  <button class="btn btn-primary">Save</button>
</script>

样品: http://bootsnipp.com/forms

0 个答案:

没有答案