2016-12-19 13 views

答えて

0

両方とも同じモデルであるため、入力ごとに異なるモデルを用意することでこの問題を解決します。オブジェクトを使用してキーをバインドすることもできます。

<div class="list"> 
    <label class="item item-input"> 
    <span class="input-label">CEP Origem: </span> 
    <input type="text" id="origem" ng-model="cep.origem" ui-br-cep-mask> 
    </label> 
    <label class="item item-input"> 
    <span class="input-label">CEP Destino: </span> 
    <input type="text" id="destino" ng-model="cep.destino" ui-br-cep-mask> 
    </label> 
</div> 
0

これは、両方の入力が同じng-modelを使用しているためです。単に異なるものを設定すると便利です

0

ng-modelは、入力によって編集される変数を定義します。

あなたの入力はng-model同じを持っているのであれば、それは、同じ変数を編集します。ここで


あなたは自分の第二の入力のNG-モデルを変更する必要があります。

<input type="text" id="origem" ng-model="cep1" ui-br-cep-mask> 
<input type="text" id="destino" ng-model="cep2" ui-br-cep-mask> 
関連する問題