Sails JS – Production mode Error: [$injector:unpr]
- Qasim Zee
- Mar 4, 2015
- 1 min read
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
1
angular
.
module
(
'MyModule'
)
.
controller
(
'MyController'
,
[
function
(
$
scope
,
$
http
,
$
log
)
{
.
.
.
}
)
;
io
1
angular
.
module
(
'MyModule'
)
.
controller
(
'MyController'
,
[
'$scope'
,
'$http'
,
'$log'
,
function
(
$
scope
,
$
http
,
$
log
)
{
.
.
.
}
]
)
;
And it works like a charm.
Please comment if this solution solved your problem.
Comentarios