(function(){
var eateryControllers=angular.module('eateryControllers',[]);
eateryControllers.controller('MainController',function($scope){
var mainCtrl=this;
mainCtrl.$on('$viewContentLoaded',function(){
console.log("view loaded");
})
});
})();
this caused an error: mainCtrl.$on is not a function. Earlier versions did this by injecting $scope. Cant we do this using 'this' keyword and 'Controller as' approach like above way