title: AngularJS: Select directive validation
body: <p>I created a directive with select template but i need the "name" tag so i can put a validation and i don't know how to add that. I tried adding attr but it didn't work.</p>
  
  <p><a href="http://jsfiddle.net/jemaineosia/jJRfw/8/" rel="nofollow">Here is the fiddle</a></p>
  
  <pre><code>&lt;form name="newForm" ng-submit="save()"&gt;
                  &lt;div&gt;
                      Name: &lt;input required ng-model="newSupplier.Name" name="myName" type="text" required/&gt;
                      &lt;span ng-show="newForm.myName.$error.required"&gt;*&lt;/span&gt;
                      &lt;br /&gt;
                      Status: &lt;keywords name="myStatus" title="Choose Status" label="" array="myKeyword" keyword-type="ActivityType" supplier-id="newSupplier.Id" opt-value="Id" opt-description="Description"&gt;&lt;/keywords&gt;
                      &lt;span ng-show="newForm.myStatus.$error.required"&gt;*&lt;/span&gt;
                      &lt;br&gt;
                      &lt;button type="submit"&gt;Save&lt;/button&gt;
                      &lt;br /&gt;&lt;i&gt;How to save the ID of the selected dropdown?&lt;/i&gt;
                      &lt;/div&gt;
                      &lt;/form&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>app.directive('keywords', function(){
      return {
          restrict: 'E',
          scope: {
              array: '=',
              supplierId : '='
          },
          template:   '&lt;label&gt;{{label}}&lt;/label&gt;' +
          '&lt;select ng-model="supplierId" ng-options="a[optValue] as a[optDescription] for a in array | filter: keywordType"&gt;' +
                          '&lt;option style="display: none" value=""&gt;-- {{title}} --&lt;/option&gt;' +
                      '&lt;/select&gt;',
          link: function (scope, element, attrs) {
              scope.label = attrs.label;  
              scope.title = attrs.title;
              scope.optValue = attrs.optValue;
              scope.optDescription = attrs.optDescription;
              scope.keywordType = attrs.keywordType;
          }
      };
  });
  </code></pre>