title: Injecting modules into AngularJS
body: <p>I'm trying to inject a <a href="https://github.com/nervgh/angular-file-upload" rel="nofollow">third party</a> file uploader into my Angular App. I had it working fine but took a break from the project and revisiting it now I've decided to use requireJS, and am having a terrible time trying to inject this module in. I'm sure it's just semantics as to how to get it to actually work but I'm not exactly sure what I am doing wrong.</p>
  
  <p>File: main.js</p>
  
  <p>Loading the uploader here and giving <code>angular</code> as the dependancy.</p>
  
  <pre><code>require.config({
  paths: {
      angular: '../bower_components/angular/angular.min',
      angularRoute: '../bower_components/angular-route/angular-route.min',
      angularFileUpload: 'modules/file-upload/angular-file-upload',
      jquery: '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min',
      fastclick: '//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.0/fastclick.min'
  },
  shim: {
      'angular' : {'exports' : 'angular'},
      'angularRoute': ['angular'],
      'angularFileUpload': ['angular'],
      'jquery': {
          exports: '$'
      }
  },
  priority: [
      "angular"
  ]
  });
  
  // http://code.angularjs.org/1.2.1/docs/guide/bootstrap#overview_deferred-bootstrap
  window.name = "NG_DEFER_BOOTSTRAP!";
  
  require( [
  'angular',
  'routes',
  'jquery',
  'fastclick',
  'app'
  ], function(angular, app) {
  'use strict';
  
       // Some config stuff here
  
  });
  </code></pre>
  
  <p>File: app.js</p>
  
  <p>This is where all of the angular modules are loaded into the app, This is mainly where I have been trying to inject the file uploader, in a similar fashion.</p>
  
  <pre><code>define([
  'angular',
  'filters',
  'services',
  'directives',
  'controllers',
  'angularRoute'
  ], function (angular, filters, services, directives, controllers) {
      'use strict';
  
      // Declare app level module which depends on filters, and services
      return angular.module('myApp', [
          'ngRoute',
          'myApp.controllers',
          'myApp.filters',
          'myApp.services',
          'myApp.directives'
      ]);
  
  });
  </code></pre>
  
  <p>File: angular-file-upload.js</p>
  
  <p>The module, It looks like it's all setup to fit in with the AMD structure.. here is the top part of the file, the rest of the file is directives and factories like <code>angularFileUpload.directive()</code></p>
  
  <pre><code>(function(angular, factory) {
  if (typeof define === 'function' &amp;&amp; define.amd) {
      define('angular-file-upload', ['angular'], function(angular) {
          return factory(angular);
      });
  } else {
      return factory(angular);
  }
  }(angular || null, function(angular) {
  /**
   * The angular file upload module
   * @author: nerv
   * @version: 0.2.9.6, 2013-12-06
  */
  var angularFileUpload = angular.module('angularFileUpload', []);
  </code></pre>
  
  <p>If anybody could provide any information on how this could be injected I would greatly appreciate it!</p>