title: Angular 2 - How to disabled button and enable it back until some value is selected in the drop down list?
body: <pre><code> &lt;select id="dpname" [(ngModel)]="nameSelectedVal"&gt;
          &lt;option value="0"&gt;Select one...&lt;/option&gt;
          &lt;option *ngFor="let name of names" value = {{name.code}}&gt; 
               {{name.definition}} 
          &lt;/option&gt;
   &lt;/select&gt;
  
  &lt;button class="btnView"&gt;VIEW&lt;/button&gt;
  </code></pre>
  
  <p>where </p>
  
  <pre><code>names = [
    {
      "code": -1,
      "definition": "Select one..."
    },
    {
      "code": 1,
      "definition": "Affiliates"
    },
    {
      "code": 2,
      "definition": "Asia/Pacific"
    },
    {
      "code": 3,
      "definition": "EMEA"
    },
    {
      "code": 4,
      "definition": "North America"
    },
    {
      "code": 5,
      "definition": "Latin America"
    },
    {
      "code": 6,
      "definition": "Web"
    }
  ]
  </code></pre>
  
  <p>So,by default i am setting nameSelectedVal value to "-1" to show "Select one..." and that is when i want to disabled button until user select some other values apart from "Select one..." and then enable it back when some other value is selected different from "Select one...".</p>
  
  <p>I am setting <code>this.nameSelectedVal = "-1"</code> in the class file;</p>
  
  <p>Thanks!</p>