The thing that struck me about it was that the $scope.displayName() function shadows itself by setting $scope.displayName again:
$scope.displayName = function () {
if ($scope.anonymous()) {
return;
}
$scope.displayName = $scope.name;
};
I have no idea how that's related to Angular, though. It looks like it's just bad programming practice.