what does $scope.$on returns ? I have seen the usage where $scope.$on returns a function and it is again used inside the $on as listener.
var test = $scope.$on('myEvent', function (evt, data) {
test();
$scope.data = true;
});