If your minified script is throwing an error such as:
Unknown provider: bProvider <- b <- myService
Look for your myService declaration:
angular('myModule').service('myService', function(anotherService) {
// ...
});
What happens during minification is that anotherService argument is being minified to 'b' (or something else). Angular will try to find the 'b' service, and when that fails it will try to find the 'bProvider' to provide the service. Since neither of these are declared, you will receive the "Unknown provider" error.
To fix this, you should change all of the dependencies to strings:
angular('myModule').service('myService', ['anotherService', function(anotherService) {
// ...
}]);
This way when minification is done, it won't mess up the dependency injection.
PS. This applies to any declaration, not just services.
I'm sorry, but this is not debugging, it's solving the problem.
Debugging is trying to find out what B is - which directive, filter, module etc hasn't the dependencies set correctly and is minified into B?