title: Where do angular helper functions go?
body: <p>I am trying to reduce code repetition with my directives. I would like to write a helper function that generates the directives instead of defining them manually. Changing the directive definition to something like:</p>
  
  <pre><code>mydirectiveBuilder(function myButton(){
    return {
      scope: {
        toggle: "@pressed"
      }
    };
  });
  </code></pre>
  
  <p>I am not sure where this should go (other then hanging it off window). Does angular provide a place for these sorts of methods to go?</p>