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

io

And it works like a charm.

Please comment if this solution solved your problem.

Sails JS + AngularJS error: CSRF mismatch

I was trying to build signup functionality with AngularJS frontend and sailsjs backend rest API. I created a simple angular post request but it was giving me following error in the browser:

CSRF mismatch

so I added the following lines to the top of post request:

Now it’s working like a charm. Please feel free to comment if you like this solution or have a better solution.