2017-08-16 2 views
1

ng-showを使用しようとしているこの基本的な例があります。私は事実上、国のドロップダウンボックスから 'GB'を選択すると、ページの一部を表示したいだけです。私はドロップダウンボックスからGBを選択すると、その中にctrlが 'GB'を受け取ることを確認しました。しかし、要素は最初にページに隠されておらず、選択ボックスから項目を選択しても影響はありません。私はどんな助けにも感謝しています。ng-showに影響がない

<ng-form name="directorsForm" cc-pitch-form="5" ng-controller="work.myCtrl as ctrl"> 
    <div class="row cc-form__group"> 
     <div class="columns large-3"> 
      <label>Country</label> 
     </div> 
     <div class="columns large-3 left"> 
      <select ng-options="country.code as country.name for country in ctrl.countryList" ng-model="ctrl.selectedCountry" /> 
     </div> 
    </div> 

    <div ng-show="ctrl.selectedCountry =='GB'"> 
     <div class="columns large-3"> 
      <label>Enter address</label> 
     </div> 
    </div> 
</ng-form> 
+1

あなたのコントローラを表示します – Sajeetharan

+1

あなたのng-showはうまく見えます、コントローラのバグ、またはng-options – awiebe

+0

コントローラにこれに関するロジックがありません。 –

答えて

0

このライン選択では、この

<select ng-options="country.code as country.name for country in ctrl.countryList" ng-model="ctrl.selectedCountry" ></select> 

自動閉鎖は、私はそれが役に立てば幸い角度で作業されていないような

<select ng-options="country.code as country.name for country in ctrl.countryList" ng-model="ctrl.selectedCountry" /> 

を交換!

関連する問題