title: AngularJS custom directive with input element, pass validator from outside
body: <p>I'm using a simple custom directive for a modified input field which occurs throughout my application:</p>
  
  <pre><code>app.directive('editor', function() {
      return {
          restrict: 'E',
          templateUrl: 'editor.html',
          scope: { value: '=' }
      };
  });
  </code></pre>
  
  <p>The <code>editor.html</code> basically creates an <code>input</code> element with additional controls. Simplified it looks like this:</p>
  
  <pre><code>&lt;div&gt;
      &lt;input ng-model="value"&gt;
      &lt;!-- more code here --&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I access my directive using <code>&lt;editor value="{{object.name}}"&gt;&lt;/editor&gt;</code>. This works perfect. Now I need to perform different validations on the input. The necessary validators to use vary, so I would like to be able to pass the actual validators to my directive. Something like: </p>
  
  <pre><code>&lt;editor value="{{object.name}}" validator-a validator-b&gt;&lt;/editor&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;editor value="{{object.name}}" validators="validatorA,validatorB"&gt;&lt;/editor&gt;
  </code></pre>
  
  <p>How could I achieve that?</p>