Slide 18
Slide 18 text
• The individual controller files are good, but should be wrapped in an
immediately-invoked function expression (IIFE) to preserve namespaces.
• None of the controllers are using inline array annotation for dependency
injection, making them unfriendly to minification.
• Controllers are binding to $scope instead of using controller as syntax
(not bad, just not best practice)
• Http calls directly in controllers is a bad idea, they should be abstracted
out into services which return the calls as promises. This allows better
testabilizy and mocking.
• She should consider using named inline functions whenever possible as
this helps with debugging (you won’t get a huge call stack of anonymous
functions)
• Some of the factories use the “revealing module” pattern, which is good,
but it’s not used consistently, and should also be used with controllers.
• I see a few directives and no jquery mixed in the angular code, which is
good.
• Code organization is generally pretty good; split up by “function” instead
of “form” which I agree with.