I'm newbie to angular JS. I had faced two different type of controller declarations which I'm unable to understand its impact behind the scene.
vmyApp.controller('GreetingController', ['$scope', function($scope) {
$scope.greeting = 'Hola!';
}]);
From the above snippet I understood they had taken a function in dependency of controller with 2 parameters one as '$scope' and other with function.
Other snippet as follows :
vmyApp.controller('GreetingController', function($scope) {
$scope.greeting = 'Hola!';
});
Here direct function as 2nd parameter to controller without any dependency.
Please explain me the differences of its impact.