title: AngularJS - Factory not working/activating
body: <p>I am trying to work with AngularJS and a Web API written in VB.NET (Doing this for my internship).</p>
  
  <p>I have my angularApp defined, same for my controller and factory.
  I'm also working with the routing from Angular and this works perfectly.
  The issue I'm dealing with is that my factory isn't activated or isn't working.</p>
  
  <p>Please take a look at the code below:</p>
  
  <p>My AngularApp.js</p>
  
  <pre><code>var angularApp = angular.module('AngularApp', ['ngRoute']);
      angularApp.config(['$routeProvider',
      function ($routeProvider) {
          $routeProvider
          .when('/ExpenseOverview', {
              controller: 'ExpenseController',
              templateUrl: 'Views/ExpenseOverview.aspx'
          })
          .when('/AddExpense',
           {
               controller: 'ExpenseController',
               templateUrl: 'Views/AddExpense.aspx'
           })
          .otherwise({ redirectTo: '/ExpenseOverview' });
      }]);
  </code></pre>
  
  <p>My ExpenseController:</p>
  
  <pre><code>angular.module("AngularApp").controller("ExpenseController", ["$scope", "ExpenseFactory", function ($scope, ExpenseFactory) {
      //variabelen
      $scope.expenses = [];
      $scope.id = 0;
      $scope.date = "";
      $scope.type = "";
      $scope.title = "";
      $scope.project = "";
      $scope.status = "";
      $scope.img = "";
  
      var shown = false;
      var dataURL = "";
  
      ExpenseFactory.getList($scope);
  }]);
  </code></pre>
  
  <p>So far my controller isn't doing much more other than retrieving a list of data from the database through the web API.</p>
  
  <p>My ExpenseFactory.js</p>
  
  <pre><code>angular.module("AngularApp").factory("ExpenseFactory", ["$http", function ($http) {
      alert("test factory");
      var factory = {};
  
      //lijst van expenses ophalen
      factory.getList = function ($scope) {
          $http.post("/api/Expense/List")
              .success(function(data) {
                  if (data === undefined || data == "") {
                      data = [];
                  }
  
                  $scope.expenses = data;
                  $scope.id = $scope.expenses[$scope.expenses.length - 1].Id + 1;
              })
              .error(function() {
                  alert("Er is een fout opgetreden");
              });
      };
  
      factory.saveList = function(expenseList) {
          $http.post("/api/Expense/SaveList", { 'expenses': expenseList })
              .success(function() {
                  alert("Expenses have been saved succesfully!");
              })
              .error(function() {
                  alert("Something went wrong while saving the expenses");
              });
      };
      return factory;  
  }]);
  </code></pre>
  
  <p>As you can see, I have put an alert as the first line of code in the factory. This alert isn't even popping up, which means the factory isn't activating/working.</p>
  
  <p>What is failing in this code?</p>
  
  <p><strong>EDIT</strong>
  I updated my code to the current version with all the comments about things that might be interfering with the code. I can confirm that none of this was working, so the error is occuring somewhere else.</p>
  
  <p>Another note: I'm working with Visual Studio 2012, if this might have something to do with it, please do elaborate how I can fix this shenannigans.</p>