1
I’m starting in Angular and in some cases I saw that you pass parameters in the bracket of the "module" and in other cases in the "Function", and in the function I’ve seen 2 forms of declaration.
Example Module:
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'ui.utils.masks', 'ngCordova', 'angular-md5', 'ngMessages', 'angularSoap'])
Example Function 1:
.config(function ($stateProvider, $urlRouterProvider, $ionicConfigProvider){...}
.controller('LoginCtrl', function ($scope, $rootScope, $pouchDB){...}
Example Function 2:
.controller('GreetingController', ['$scope, $any', function($scope, $any){...}
Could someone explain to me:
- What is the difference between the declaration of Function 1 and Function 2 (why there are these 2 forms and what would be the practical impact in choosing one or the other)?
- What’s the difference between passing these parameters in the module and functions?
- Is there any connection between them?
- What goes on and what can go on in these parameters
Don’t just stick to my questions. The more information, the better, but at first my doubts are those above.