title: AngularJS Call function from another file
body: <p>When I trying call function from another file I get error: </p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'getCurrentUserFullName' of undefined</p>
  </blockquote>
  
  <p>in app.js:</p>
  
  <pre><code>    'use strict';
  
      var testApp = {};
  
      var App = angular.module('testApp', ['testApp.filters', 'testApp.services', 'testApp.directives',
              'ngRoute']);
  
      App.run(['$location', '$rootScope', function ($location, $rootScope) {
  
          $rootScope.$on("$routeChangeSuccess", function (event, currentRoute, previousRoute, AuthUtils) {
             if(!$rootScope.userFullName){
                  var userFullName = AuthUtils.getCurrentUserFullName();
                  if(userFullName) {
                      $rootScope.userFullName = userFullName;
                      $rootScope.authenticate = true;
                  } else {
                      $rootScope.authenticate = false;
                      $rootScope.userFullName = "";
                  }
              }
          });
  
      }]);
  </code></pre>
  
  <p>AuthUtils.js</p>
  
  <pre><code>    'use strict';
  
      angular.module('testApp')
          .factory('AuthUtils', function AuthUtils($rootScope, $http) {
              return {
                  getCurrentUserFullName: function () {
                      $http.get('auth/userFullName').success(function (user) {
                          return user;
                      }).error(function (data, status) {
                          return "error";
                          console.error(status, data);
                      });
                  }
              };
          });
  </code></pre>
  
  <p>Why doesn't work?</p>