Kashif Khan Kashif Khan - 11 days ago 6
AngularJS Question

angular.js:xxxx Error: [$injector:unpr] Unknown provider: cookiesServiceProvider <- cookiesService

I am getting the following error from angular.js library. How can i debug the below console error?

angular.js:12477 Error: [$injector:unpr] Unknown provider: cookiesServiceProvider <- cookiesService <- CatalogViewController
http://errors.angularjs.org/1.4.7/$injector/unpr?p0=cookiesServiceProvider%20%3C-ookiesService%20%3C-%20CatalogViewController
at http://testsite/Scripts/angular_bootstrap_UI/angular.js:68:12
at http://testsite/Scripts/angular_bootstrap_UI/angular.js:4289:19
at Object.getService [as get] (http://testsite/Scripts/angular_bootstrap_UI/angular.js:4437:39)
at http://testsite/Scripts/angular_bootstrap_UI/angular.js:4294:45
at getService (http://testsite/Scripts/angular_bootstrap_UI/angular.js:4437:39)
at invoke (http://testsite/Scripts/angular_bootstrap_UI/angular.js:4469:13)
at Object.instantiate (http://testsite/Scripts/angular_bootstrap_UI/angular.js:4486:27)
at http://testsite/Scripts/angular_bootstrap_UI/angular.js:9151:28
at http://testsite/Scripts/angular-ui-router.js:4018:28
at invokeLinkFn (http://testsite/Scripts/angular_bootstrap_UI/angular.js:8789:9)

Answer

You need to include the cookies part of angular

https://code.angularjs.org/1.4.7/angular-cookies.js

and inject it in your module

angular.module('myModule', ['ngCookies'])

make sure you don't get 404 for the cookies