Angular: 'this' and $scope

http://angularjs.org/

by mrajcok

HTML

<div ng-controller="ParentCtrl">
   <a ng-click="logThisAndScope()">log "this" and $scope</a> - parent scope
   <div ng-controller="ChildCtrl">
      <a ng-click="logThisAndScope()">log "this" and $scope</a> - child scope
   </div>
</div>

JavaScript

var myApp = angular.module('myApp', []);

//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});

function ParentCtrl($scope) {
    $scope.logThisAndScope = function() {
        console.log(this, $scope)
    }
}
function ChildCtrl($scope) {}