title: Understanding Angular.js controller parameters
body: <p>I'm just starting to learn Angular.js and I've been looking at the <a href="http://angularjs.org/#wire-up-a-backend" rel="noreferrer">project.js in the "Wire up a Backend" example on the Angular home page</a>.</p>
  
  <p>I'm confused about the parameters in the controller functions:</p>
  
  <pre><code>function ListCtrl($scope, Projects) {
    ... 
  }   
  
  function CreateCtrl($scope, $location, $timeout, Projects) {
    ... 
  }
  
  function EditCtrl($scope, $location, $routeParams, angularFire, fbURL) {
     angularFire(fbURL + $routeParams.projectId, $scope, 'remote', {}).
     then(function() {
       ...
     });
  }  
  </code></pre>
  
  <p>These controller functions are called in the routeProvider, but none of the parameters are given.</p>
  
  <pre><code>$routeProvider.
    when('/', {controller:ListCtrl, templateUrl:'list.html'}).
    when('/edit/:projectId', {controller:EditCtrl, templateUrl:'detail.html'}).
    when('/new', {controller:CreateCtrl, templateUrl:'detail.html'}).
    otherwise({redirectTo:'/'});
  });
  </code></pre>
  
  <p>The only thing I could find so far that possibly explains what's going is <a href="http://docs.angularjs.org/guide/dev_guide.services.injecting_controllers" rel="noreferrer">"Injecting Services Into Controllers"</a>, which explains <code>$location</code>, <code>$timeout</code>, but not parameters method <code>angularFire</code> and <code>fbURL</code>.</p>
  
  <p>My specific questions are:</p>
  
  <ol>
  <li><p>What can the controller parameters be?</p></li>
  <li><p>Where are the controller functions called with their parameters? Or the parameters are not called but are just stuff associated with the controller where the association occurs with lots of Angular.js magic (if so, can I see the source code on github)?</p></li>
  <li><p>Where is <code>angularFire</code> defined?</p></li>
  <li><p>How is the <code>fbURL</code> in the parameter linked to:</p>
  
  <pre><code>angular.module('project', ['firebase']).
      value('fbURL', 'https://angularjs-projects.firebaseio.com/').
      factory ...
  </code></pre></li>
  <li><p>Is there a place where I can see all the services, e.g. <code>$location</code> and <code>$timeout</code>, that Angular.js provides? (I tried to find the list but failed.)</p></li>
  </ol>