title: How to make directives look for two parameters?
body: <p>I have two elements and will have more looking like these:</p>
  
  <pre><code>&lt;chart type="type-one" legend="true"&gt;&lt;/chart&gt;
  &lt;chart type="type-two" legend="true"&gt;&lt;/chart&gt;
  </code></pre>
  
  <p>Each element is supposed to be processed by its own directive put in a separate file.
  How can I make these directives look for both element name to be <code>chart</code> and <code>type</code> attribute to be present to be processed?</p>
  
  <p><strong>Update:</strong> @vittore, thanks for the extended answer! My issue is I want to have different types of chart that are processed by directives from different files, resulting in not having one giant file that processes <code>chart</code> elements with inner functions running for each type of chart, but rather more modularized files that are in charge for processing each chart type.</p>
  
  <p>Now I do it like this:</p>
  
  <pre><code>app.directive('chart', function () {
    return {
      restrict: 'E',
      require: 'ngModel',
      scope: {
        'ngModel': '=',
        'showGrouped': '='
      },
  
      link: function (scope, element, attrs, ctrl) {
        if (attrs.type != 'type-one') {return}
        render()
      }
    }
  });
  </code></pre>
  
  <p>So I check for the type attribute and if it's not some value, return, otherwise run respective rendering code. I have this piece of code in each directive file that does specific chart type rendering. I am sure there is something wrong in this approach.</p>
  
  <p>Please advise!</p>