title: Module extension, to not repeat myself
body: <p>I'm working on my first Angular project.</p>
  
  <p>Basically, I have two modules which have too much in common, module A, and module B which just have extended features of module A. So for clarity sake, module A is the parent, B the child.</p>
  
  <p>What I'm trying to do :</p>
  
  <pre><code>var modA = angular.module('modA', [...]);
  // module A controllers, directives, services and stuff
  
  var modB = angular.module('modB', ['modA']);
  // some other directives and services depending on module A 
  
  modA.controller('main', function(scope){
     // Here it should execute modA controller logic
  
     // @override 
     var someFunctionInModA = function(){
          parent.someFunctionInModA(); // also not sure how this is done
          // other stuff
      }
  
  });
  </code></pre>
  
  <p>What I found so far :</p>
  
  <pre><code>angular.extend(this, $controller('modA', {$scope: $scope}));
  </code></pre>
  
  <p>Similar things exists for services, some uses $injector, I'm missing some clear (and simple) ressources about the subject.</p>