title: Understanding dependency injection in AngularJS controllers
body: <p>Just learning dependency injection, and I think I'm starting to understand it.</p>
  
  <p>Please tell me if I'm on the right track...</p>
  
  <p>E.g.: Are these two equivalent?</p>
  
  <pre><code>/* injection method */
  function &lt;controller_name&gt;($scope) {}
  &lt;controller_name&gt;.$inject = ['$scope'];
  
  /* other method */
  var app = angular.module('myApp');
  app.controller(&lt;controller_name&gt;, function($scope) {});
  </code></pre>