title: Error: [ng:areq] from angular controller
body: <p>This is a long shot, but has anyone seen this error before? I am trying to add 'Transporters' using express, angular and mongoDB. I get this error whenever I access a page ruled by the transporters controller:</p>
  
  <pre><code>Error: [ng:areq] http://errors.angularjs.org/1.2.12/ng/areq?p0=TransportersController&amp;p1=not%20aNaNunction%2C%20got%20undefined
      at Error (native)
      at http://localhost:3000/lib/angular/angular.min.js:6:450
      at tb (http://localhost:3000/lib/angular/angular.min.js:18:360)
      at Pa (http://localhost:3000/lib/angular/angular.min.js:18:447)
      at http://localhost:3000/lib/angular/angular.min.js:62:17
      at http://localhost:3000/lib/angular/angular.min.js:49:43
      at q (http://localhost:3000/lib/angular/angular.min.js:7:386)
      at H (http://localhost:3000/lib/angular/angular.min.js:48:406)
      at f (http://localhost:3000/lib/angular/angular.min.js:42:399)
      at http://localhost:3000/lib/angular/angular.min.js:42:67 
  </code></pre>
  
  <p>The transporters controller looks like this:</p>
  
  <pre><code>'use strict';
  
  angular.module('mean.transporters').controller('TransportersController', ['$scope', '$routeParams', '$location', 'Global', 'Transporters', function ($scope, $routeParams, $location, Global, Transporters) {
      $scope.global = Global;
  
      $scope.create = function() {
          var transporter = new Transporters({
              name: this.name,
              natl_id: this.natl_id,
              phone: this.phone
          });
          transporter.$save(function(response) {
              $location.path('transporters/' + response._id);
          });
  
          this.title = '';
          this.content = '';
      };
  
      $scope.remove = function(transporter) {
          if (transporter) {
              transporter.$remove();
  
              for (var i in $scope.transporters) {
                  if ($scope.transporters[i] === transporter) {
                      $scope.transporters.splice(i, 1);
                  }
              }
          }
          else {
              $scope.transporter.$remove();
              $location.path('transporters');
          }
      };
  
      $scope.update = function() {
          var transporter = $scope.transporter;
          if (!transporter.updated) {
              transporter.updated = [];
          }
          transporter.updated.push(new Date().getTime());
  
          transporter.$update(function() {
              $location.path('transporters/' + transporter._id);
          });
      };
  
      $scope.find = function() {
          Transporters.query(function(transporters) {
              $scope.transporters = transporters;
          });
      };
  
      $scope.findOne = function() {
          Transporters.get({
              transporterId: $routeParams.transporterId
          }, function(transporter) {
              $scope.transporter = transporter;
          });
      };
  }]);
  </code></pre>
  
  <p>In my views I call the list and create methods. They generate the above error</p>
  
  <p>I got this from the angular docs for <a href="http://docs.angularjs.org/error/ng%3aareq">ng:areq</a> though still can't figure what's going on</p>
  
  <blockquote>
    <p>AngularJS often asserts that certain values will be present and truthy
    using a helper function. If the assertion fails, this error is thrown.
    To fix this problem, make sure that the value the assertion expects is
    defined and truthy.</p>
  </blockquote>
  
  <p>Here's the view that calls the controller <code>public/views/transporters/list.html</code>:</p>
  
  <pre><code>&lt;section data-ng-controller="TransportersController" data-ng-init="find()"&gt;
      &lt;ul class="transporters unstyled"&gt;
          &lt;li data-ng-repeat="transporter in transporters"&gt;
              &lt;span&gt;{{transporter.created | date:'medium'}}&lt;/span&gt; /
              &lt;h2&gt;&lt;a data-ng-href="#!/transporters/{{transporter._id}}"&gt;{{transporter.name}}&lt;/a&gt;&lt;/h2&gt;
              &lt;div&gt;{{transporter.natl_id}}&lt;/div&gt;
              &lt;div&gt;{{transporter.phone}}&lt;/div&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
      &lt;h1 data-ng-hide="!transporters || transporters.length"&gt;No transporters yet. &lt;br&gt; Why don't you &lt;a href="/#!/transporters/create"&gt;Create One&lt;/a&gt;?&lt;/h1&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>Transporters service code:</p>
  
  <pre><code>angular.module('transporterService', [])
      .factory('Transporter', ['$http', function($http){
          // all return promise objects
          return {
              get: function(){
                  return $http.get('/api/transporters');
              },
              create: function(transporterData){
                  return $http.post('/api/transporters', transporterData);
              },
              delete: function(id){
                  return $http.delete('/api/transporters/'+id);
              }
          };
      }]);
  </code></pre>