title: How to give an error message if no value has been selected after button click in AngularJS
body: <p>I have a selectlist and a button,I need to give an error message if the user clicks the button without selecting a value in the selectlist in AngularJS. I found-out that you need to include required which I did,but how would I include an alert box telling the user that they need to select a value first.Here is my code:
  Oh this is how my JS page is structured </p>
  
  <p>HTML</p>
  
  <pre><code> &lt;select  ng-disabled="Model.CurrentDowntime.CategoryId !== undefined"  ng-model="Model.CurrentDowntime.CategoryId" ng-options="downtimeCategory.CategoryId as downtimeCategory.CategoryName for downtimeCategory in Model.DowntimeCategories"  required&gt;
              &lt;option value=""&gt;--SELECT--&lt;/option&gt;
          &lt;/select&gt; 
  
     &lt;button ng-click="Model.StartDowntimeEvent()" id="btnEventStart" class="tooltip"&gt;Start&lt;/button&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>function Model($http) {
      var self = this;
      self.$http = $http;
  
   self.StartDowntimeEvent = function () {
  //Something
  }
  }
  
  angular.module('myApp', [])
  
   .controller('DowntimeController', function ($scope, $http) {
       $scope.Model = new Model($http);
  });
  </code></pre>