Within my Angular application
var mainApp = angular.module('mainApp', ['ngCookies']);
I have created the authCtrl
controller:
mainApp.controller('authCtrl', ['$scope, $cookies',function ($scope, $http, $cookies) {
$scope.credentials = {};
$scope.signCheck = function () {
a = $cookies.getObject('session_credentials');
console.log(a);
};
}]);
When I remove the $scope
declaration from the array of injections:
mainApp.controller('authCtrl', ['$cookies',function ($scope, $http, $cookies) {
$scope
becomes undefined.
If I omit $cookies
, then it also becomes undefined.
And if both are kept, an unknown provider error is thrown by $injector.
What mistake am I making?