title: Angular 2 : Show div based on dropdown value
body: <p>I have a dropdown menu and based on the selection of the value , respective div should be shown.</p>
  
  <p>I have tried the following code. but it doesn't work.</p>
  
  <pre class="lang-js prettyprint-override"><code>export class PropertyComponent {
  regTypeSelectedOption: string = "";
  selectedNav: any; navs = ['option 1', 'option 2', 'option 3']
  
  ngOnInit() {
      this.selectedNav = 'select value';
  }
  setNav(nav:any){
          this.selectedNav = nav;
              if(this.selectedNav == "option 1"){
                  this.regTypeSelectedOption = "option 1";
              }
              else if(this.selectedNav == "option 2"){
                  this.regTypeSelectedOption = "option 2";
              }
              else if(this.selectedNav == "option 3"){
                  this.regTypeSelectedOption = "option 3";
              }
          }
  
  }
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.0/angular2.js"&gt;&lt;/script&gt;
  &lt;div class="common_select_box"&gt;
  &lt;div class="input-group-btn dropdown {{dropdown1? 'open':''}}" 
  (click)="dropdown1=!dropdown1"&gt;
      &lt;button type="button" class="btn btn-default font_size_12 no_box_shadow 
  ticket_info_subline_text_color" dropdown-toggle=""
          aria-haspopup="true" aria-expanded="false"&gt;{{selectedNav}}&lt;span 
  class="caret" style="color: #bfbfbf;"&gt;&lt;/span&gt; &lt;/button&gt;
  &lt;ul class="dropdown-menu"&gt;
   &lt;li (click)="setNav(item)" *ngFor="let item of navs"&gt;{{item}}&lt;/li&gt;
    &lt;/ul&gt;
  
    &lt;div *ngIf="regTypeSelectedOption == 'option 1'"&gt;
    option 1 
    &lt;/div&gt;
  
    &lt;div *ngIf="regTypeSelectedOption == 'option 2'"&gt;
    option 2 
    &lt;/div&gt;
  
    &lt;div *ngIf="regTypeSelectedOption == 'option 1'"&gt;
    option 3 
    &lt;/div&gt;
  </code></pre>
  
  
  
  <p>Any help would be great.</p>
  
  <p>Thank You.</p>