They both provide the same functionality but Syntax A
(inline bracket notation) allows for your code to be minified through a JavaScript minifier. Because Syntax A
is a little longer than Syntax B
(and violates the DRY principle), the most appropriate and probably only case you'd want to use it would be when you want to minify your code.
Since Angular infers the controller's dependencies from the names of arguments to the controller's constructor function, if you were to minify the JavaScript code for [the] PhoneListCtrl controller, all of its function arguments would be minified as well, and the dependency injector would not be able to identify services correctly.