title: How to call module factory from another module in Angular.js?
body: <p>I have problems with call a factory in one module from another module. I am using angular.js + require.js.
  Here is my code
  Module 1:</p>
  
  <pre><code>define(['angular', 'app/admin/app.admin', 'app/admin/account/services'], function (angular, app, services) {
    app.controller('MainCtrl', ['$scope', 'providerService', function ($scope, providerService) {
      $scope.showMe = false;
      $scope.provider = providerService.Providers;
    }]);
  
  
    return app;
  });
  </code></pre>
  
  <p>Module 2</p>
  
  <pre><code>define(['angular', 'app/admin/config/index'], function (angular) {
    'use strict';
  
    var service = angular.module('app.admin.account.services', []);
  
    service.factory('providerService', ['app.admin.config',
      function (config) {
        var providers = [
          { name: 'google+', url: config.AUTH_URL + '/google' },
          { name: 'facebook', url: config.AUTH_URL + '/facebook' }
        ];
        return {
          Providers: providers
        };
      }
    ]);
  
    return service;
  });
  </code></pre>
  
  <p>When i try to call providerService in module 2 from module 1. I got an error say providerService is not there. Can someone tell me what I did wrong here?</p>
  
  <p>Cheers</p>