I am totally confused about inject in Angular. I do not know where to use it and why. Is it only used with factory as described here?
myController.$inject =
To complement @mark answer, it is important to note that using the $inject method in the style of:
MyController.$inject = ['$scope', 'notify'];
allows you to add injection dependencies when building providers which are the only angular recipes that don't allow 'friendly' annotation style i.e.:
.controller('MyController', ['$scope', 'notify',...
dependencies to be declared.