I m new to Angular JS and I was going through few angular JS tutorials. The below one is one of the controller method. In the first case, $scope is included as part of the array string but in the second case $scope is injected in the function alone but both works fine. What is the difference and which approach has to be used?
app.controller('myController', ['$scope', function ($scope) {
$scope.message = "Test Success";
}]);
app.controller('myController', function ($scope) {
$scope.message = "Test Success";
});