Q:

Adding Services to Controllers in AngularJS

I'm trying to identify if I understand some core concepts in AngularJS. If I have a line of code that says:
.controller('MyCtrl', function($scope) { 

and I change it to:
.controller('MyCtrl', function($scope, $myService) { 

Is it correct to say that "$myService was injected into MyCtrl". Or is it more correct to say that "$myService is injected as a dependency of MyCtrl"? Or, should it be said some other way entirely?
Thank you so much!

A:

It is correct to say that you inject service in a controller as you would be using service methods in that controller, either as a data transfer across multiple controllers or by getting it via server.
It is recommended to inject service using this notation
.controller('MyCtrl', ['$scope','$myService',function($scope, $myService) {}]);

As when you minify your controller js then it will give no errors in this format.

