4 ms·
The thing that struck me about it was that the $scope.displayName() function shadows itself by setting $scope.displayName again: $scope.displayName = f
by delluminatus 12y ago
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.
- dmak 12y agoI agree completely. You wouldn't do this any ANY language let alone Angular. However, I get he is trying to make a point that junior developers are using the $scope too trivially therefore causing slow performances, but this can be easily overcome by just incorporating better conventions into your codebase.
- poxrud 12y agoYes not to mention that displayName() will crash next time it will get called.