Edit: Thanks to deoD for pointing me to the right place - this is a duplicate of Angularjs minify best practice
I feel like this must be a pretty simple thing, but I don't know the name of it and Googling hasn't turned up much :/
Some Ionic tutorials that I've seen define controllers (and factories, etc) like this to inject a dependency
angular.module( 'x' )
.controller( 'XController', function( $scope ) {
// ...
} );
And some define it like this
angular.module( 'x' )
.controller( 'XController', [ '$scope',
function( $scope ) {
// ...
}
] );
What's the difference between the two, and if that doesn't answer the following question, when would you use one over the other?