title: Angular stops working when injecting a factory
body: <p>I have a resolve that I inject services and factories into. When I inject a factory I just made called ValidationMatrixFactory nothing works anymore. The homepage loads but links no longer resolve, basically clicking on anything has no effect. Angular does not throw any errors. Everything just stops working. I've tried multiple browsers, restarting IIS, all to no effect.</p>
  
  <p>The console.log statement in the resolve is never hit. Here's the resolve:</p>
  
  <pre><code>        resolve: {
              eventData: ['$http', '$stateParams', 'ViewMatrixService', 'ValidationMatrixFactory', function ($http, $stateParams, ViewMatrixService, ValidationMatrixFactory) {
                  console.log('EventId: ' + $stateParams.eventId);
                  return $http.get('http://localhost:10569/api/eventView/' + $stateParams.eventId).then(function (response) {
                      ViewMatrixService.GenerateViewMatrix(response.data);
                      ValidationMatrixFactory.GenerateValidationMatrix(response.data);
                      return response.data;
                  });
              }]
          }
  </code></pre>
  
  <p>Everything works if I take out the references to ValidationMatrixFactory. ValidationMatrixFactory is very similar to ViewMatrixService so I'm not sure why it's a problem now.</p>
  
  <p>Here's ValidationMatrixFactory:</p>
  
  <pre><code>angular.module('myWebApp.services')
      .factory('ValidationMatrixFactory', function() {
          var ValidationMatrixFactory = {};
  
          ValidationMatrixFactory.GenerateValidationMatrix = function (eventData) {
              var currentStage = eventData.CoreEvent.Stage;
              initializeValidationMatrix();
              determineRequiredFields(currentStage);
          }
  
          function initializeValidationMatrix() {
              ValidationMatrixFactory.EventTitleRequired = false;
              ValidationMatrixFactory.EventSummaryRequired = false;
              ValidationMatrixFactory.DesiredPublicationDateRequired = false;
              ValidationMatrixFactory.DesiredEffectiveDateRequired = false;
              ValidationMatrixFactory.ReasonForDesiredEffectiveDateRequired = false;
              ValidationMatrixFactory.AssessmentTargetDateRequired = false;
              ValidationMatrixFactory.FRSOTargetDateRequired = false;
              ValidationMatrixFactory.BLRTargetDateRequired = false;
              ValidationMatrixFactory.SSOTargetDateRequired = false;
              ValidationMatrixFactory.BLSOTargetDateRequired = false;
              ValidationMatrixFactory.FSOTargetDateRequired = false;
              ValidationMatrixFactory.PublicationTargetDateRequired = false;
              ValidationMatrixFactory.EffectiveTargetDateRequired = false;
              ValidationMatrixFactory.RMRequired = false;
              ValidationMatrixFactory.PublisherRequired = false;
              ValidationMatrixFactory.MoPRequired = false;
              ValidationMatrixFactory.PriorityRequired = false;
          }
  
          function determineRequiredFields(currentStage) {
              ValidationMatrixFactory.EventTitleRequired = true;
              ValidationMatrixFactory.EventSummaryRequired = true;
              ValidationMatrixFactory.ReasonForDesiredEffectiveDateRequired = true;
              ValidationMatrixFactory.DesiredPublicationDateRequired = true;
              ValidationMatrixFactory.DesiredEffectiveDateRequired = true;
  
              if (currentStage.StageNumber &gt; 1) {
                  ValidationMatrixFactory.AssessmentTargetDateRequired = true;
                  ValidationMatrixFactory.FRSOTargetDateRequired = true;
                  ValidationMatrixFactory.BLRTargetDateRequired = true;
                  ValidationMatrixFactory.SSOTargetDateRequired = true;
                  ValidationMatrixFactory.BLSOTargetDateRequired = true;
                  ValidationMatrixFactory.FSOTargetDateRequired = true;
                  ValidationMatrixFactory.PublicationTargetDateRequired = true;
                  ValidationMatrixFactory.EffectiveTargetDateRequired = true;
                  ValidationMatrixFactory.RMRequired = true;
                  ValidationMatrixFactory.PublisherRequired = true;
                  ValidationMatrixFactory.MoPRequired = true;
              }
  
              if (currentStage.StageNumber &gt; 2) {
                  ValidationMatrixFactory.PriorityRequired = true;
              }
          }
  
          ValidationMatrixFactory.ValidateFields = function (saveType) {
  
          }
      });
  </code></pre>
  
  <p>I have a reference to the script in index.html.</p>
  
  <pre><code>    &lt;script src="libraries/angular/1.4.8/angular.min.js"&gt;&lt;/script&gt;
      &lt;script src="libraries/angular/1.4.8/angular-animate.min.js"&gt;&lt;/script&gt;
      &lt;script src="libraries/angular-ui-router/0.2.14/angular-ui-router.min.js"&gt;&lt;/script&gt;
      &lt;script src="libraries/angular-scroll/angular-scroll.min.js"&gt;&lt;/script&gt;
      &lt;script src="libraries/uiboostrap/0.14.3/ui-bootstrap-tpls-0.14.3.min.js"&gt;&lt;/script&gt;
      &lt;script src="libraries/dirPagination/dirPagination.js"&gt;&lt;/script&gt;
      &lt;script src="libraries/angular-loading-bar/loading-bar.js"&gt;&lt;/script&gt;
      &lt;script src="libraries/ng-file-upload/ng-file-upload.min.js"&gt;&lt;/script&gt;
      &lt;script src="libraries/ng-file-upload/ng-file-upload-shim.min.js"&gt;&lt;/script&gt;
      &lt;script src="js/app.services.js"&gt;&lt;/script&gt;
      &lt;script src="js/view.matrix.service.js"&gt;&lt;/script&gt;
      &lt;script src="js/validation.matrix.factory.js"&gt;&lt;/script&gt;
      &lt;script src="js/utility.service.js"&gt;&lt;/script&gt;
      &lt;script src="js/app.controllers.js"&gt;&lt;/script&gt;
      &lt;script src="partials/events/EventCtrl.js"&gt;&lt;/script&gt;
      &lt;script src="partials/events/EventHeaderCtrl.js"&gt;&lt;/script&gt;
      &lt;script src="partials/events/EventOverviewTabCtrl.js"&gt;&lt;/script&gt;
      &lt;script src="partials/events/EventAdditionalInformationTabCtrl.js"&gt;&lt;/script&gt;
      &lt;script src="partials/events/EventDSOTabCtrl.js"&gt;&lt;/script&gt;
      &lt;script src="partials/events/EventFooterCtrl.js"&gt;&lt;/script&gt;
      &lt;script src="js/nonAngular.js"&gt;&lt;/script&gt;
      &lt;script src="js/app.js"&gt;&lt;/script&gt;
  </code></pre>