title: Angular Material md-checkbox required
body: <p>I have a group of checkboxes which are the days of the week. If the user clicks the submit button and no checkboxes have been checked, I want to display an error message. Below is the HTML code I'm using.</p>
  
  <pre><code>&lt;form id="addEditForm" name="addEditForm" ng-submit="addEditForm.$valid &amp;&amp; saveBooking()" novalidate&gt;
      &lt;div ng-repeat="item in days"&gt;
          &lt;md-checkbox ng-required="daysSelected.length == 0" ng-checked="dayExists(item, daysSelected)" ng-click="toggleWeekdays(item, daysSelected)" name="daysOfWeek"&gt;{{ item }}&lt;/md-checkbox&gt;
      &lt;/div&gt;
  
      &lt;div flex ng-messages="addEditForm.daysOfWeek.$error" ng-if="addEditForm.$submitted"&gt;
          &lt;div ng-message="required"&gt;Please select a day.&lt;/div&gt;
      &lt;/div&gt;
  
      &lt;md-button aria-label="Save Booking" class="md-primary-short" type="submit" &gt;Save&lt;/md-button&gt;
  &lt;/form&gt;
  </code></pre>