My service is working as expected in both cases but I don't understand the difference between these 2 syntaxes. Enlighten me please. The official documentation is not very explicit about this point.
Syntax A :
service.factory('Alert',['$rootScope', '$timeout', function($rootScope, $timeout) {
//Do stuff
}]);
Syntax B :
service.factory('Alert', function($rootScope, $timeout) {
//Do stuff
});