title: Difference between this and scope in the controller
body: <p>I'm new to angularjs.
  What is the difference if You assign function to $scope or this keywords in the controller?
  Thank You.</p>
  
  <p>Example (scope):</p>
  
  <pre><code>.controller('TestCtrl', ['$scope', function ($scope) {
      $scope.testFunc = function () {
      };
  }]);
  </code></pre>
  
  <p>Example (this)</p>
  
  <pre><code>.controller('TestCtrl', [function () {
      var app = this;
      app.testFunc = function () {
      };
  }]);
  </code></pre>