4 ms·
In this case it might not be needed, but some controllers have calls that are made on initialisation (like NgResource) which makes harder to use $httpBackend (y
by _mikz 13y ago
In this case it might not be needed, but some controllers have calls that are made on initialisation (like NgResource) which makes harder to use $httpBackend (you have to mock all calls if you want to verify that no calls were left at the end).
I took the article more like best-practice for unit testing controllers.
But truth to be told, it would be nicer if author would explain why to initialise controller in a method etc.