I'm kind of new to AngularJS.
In a text on how to use AngularJS modules I came across the following code
var myApp = angular.module('myApp', []);
myApp.controller('MainCtrl', ['$scope', function ($scope) {
$scope.text = 'Hello, Angular fanatic.';
In this case we are defining a module. Modules as I get are a way to avoid global variables and they define a scope within the rootscope and act as a container for controllers and other objects.
In the myApp.controller(..) line we are passing the $scope object, and also a function object which uses the $scope object. I do not know why it is required to pass the $scope argument. Why is it not possible to just use the $scope variable directly without injecting it into the controller, which I guess is what the first variable in the array is doing.
When a controller is used in an ng-controller tag, then I guess a $scope is automatically created and appended. In that case, isn't it redundant to pass the $scope.