title: AngularJS - extending module with own types / providers
body: <p>I want to ad a new (dialog) <code>type</code> to angular, so I could use it just like I use <code>module.directive</code>, <code>module.filter</code>, <code>module.controller</code> to register directives, filters and controllers.</p>
  
  <p>I want to register my instances of <code>dialog</code> type this way:</p>
  
  <pre><code>module.dialog('prompt',function(dependencies){
      return {
          templateUrl:'prompt.html',
          controller:function($scope){},
          something:'value'
      }
  });
  </code></pre>
  
  <p>I also want to be able to use registered dialogs in controllers (dependency injection)</p>
  
  <pre><code>module.controller('ListCtrl',function($scope,prompt){
      $scope.deleteItem = function(item){
          prompt('Do you want to delete this item?').then(function(result){
              if(result) item.$delete();
          });
      }
  });
  </code></pre>
  
  <p><strong>This boils down to the following questions:</strong></p>
  
  <ol>
  <li><p>How do I extend angular's module to have <code>module.dialog</code> register my <code>dialog</code> types ?</p></li>
  <li><p>How do I make my registered <code>dialogs</code> injectable in to <code>controllers</code> etc?</p></li>
  </ol>
  
  <p>Btw, </p>
  
  <ul>
  <li><em>I know about <code>angular-ui</code> and <code>angular-strap</code></em>.</li>
  <li><em>I would rather not use <code>dialog</code> as a service, but as a separate <code>type</code> (this solution is already implemented in <code>angular-ui</code>).</em></li>
  </ul>