From eggheadio lesson 22, I see a controller returning itself. Why does it have to return this? I thought just assigning scope's property to indicative name of the controller itself would do the trick.
var app = angular.module("phoneApp",[]);
app.controller("AppCtrl", function($scope){
this.sayHi = function(){ alert("hi");}
$scope.AppCtrl = this;
//return $scope.AppCtrl = this; //why this one when above line also works
})
and in html
<body ng-app="phoneApp">
<div ng-controller="AppCtrl">
<button ng-click="AppCtrl.sayHi()"></button>
</div>
</body>