Sails JS – Production mode Error: [$injector:unpr]

I just encountered another error and in production mode that angular JS controllers were not being loaded properly and I was getting the error like:

Error: [$injector:unpr] ...

To fix this, just change the declaration of your AngularJS controllers from


And it works like a charm.

Please comment if this solution solved your problem.