title: What does the actual angular js controller object contain?
body: <p>I am a pretty new computer science student with a good amount of experience in C++, but I am just getting started with Javascript. </p>
  
  <p>I've been trying to understand how Angular Js works and I'm a little stuck on controllers. I understand the basics of how they can be used, but I can't decipher the syntax for how they are constructed and what they actually are. </p>
  
  <p>The w3 tutorial states that "A controller is a JavaScript Object, created by a standard JavaScript object constructor."</p>
  
  <p>And the syntax for creating a controller is:</p>
  
  <pre><code>var app = angular.module('myApp', []);
  app.controller('myCtrl', function($scope) {
  });
  </code></pre>
  
  <p>What part of this code is the object constructor?
  I might be completely wrong, but to someone inexperienced in javascript it looks like the "controller" function of the app object is being called with 'myCtrl' and 'function($scope){} as parameters. </p>
  
  <p>Can anyone explain to me what the second line of this code is actually doing and why those parameters are passed to it? </p>
  
  <p>Also where/what is the actual controller object? If I wanted to physically log the controller object how would I refer to it? </p>
  
  <p>Thanks for your help!</p>