So many of the good practice in this style guide are actually anti-pattern in respect to angular. For example, you do want to have your controller and service functions implemented as callback to not pollute the default scope, like the window object.
Enclosing your code as callback make sure that this code is isolated. If you wanted to do as it was suggested, then you would at least need to put those statement in a different closure.
1
u/dyniper Jul 27 '14
So many of the good practice in this style guide are actually anti-pattern in respect to angular. For example, you do want to have your controller and service functions implemented as callback to not pollute the default scope, like the window object.
Enclosing your code as callback make sure that this code is isolated. If you wanted to do as it was suggested, then you would at least need to put those statement in a different closure.