0
votes

In my base controller I added ngCookies:

var app = angular.module("MyApp", ["ui.router", "ngCookies"]);

Then in my Login controller that handles logins I did:

(function () {
    angular.module("MyApp").controller("LoginCtrl", ["$scope", "$state", "$http", "$cookies", MyLogin]);

    function MyLogin($scope, $state, $http, $cookies) {

    }

})();

And now I am getting an error:

Error: [$injector:unpr] Unknown provider: $cookiesProvider <- $cookies <- LoginCtrl

I have references set for angular-cookies.min.js

<script type="text/javascript" src="Scripts/angular.js"></script>
<script type="text/javascript" src="Scripts/angular-cookies.min.js"</script>
1

1 Answers

0
votes

Maybe you have some problem with the scripts references because, as you can see in this jsbin, everything works well.

Debug your html code and see if the angular-cookies library it's correctly included ;)