I am unable to get the cookies in Angular.js. The code which I used is
angular.module('Routes', ['ngRoute','reviewService']).config(['$routeProvider','$locationProvider','$cookies','$cookieStore',
function($routeProvider, $locationProvider,$cookies,$cookieStore) {
var user=$cookies['username']
if(user !='undefined')
{
$routeProvider
.when('/', {
templateUrl: '/view/home.html',
controller: 'myController'
})
............
The error which I am getting in browser console is
Error: [$injector:modulerr] Failed to instantiate module Routes due to:
Error: [$injector:unpr] Unknown provider: $cookies
........
$usernameexist in cookies??Unknown provider: $cookiestells you that you didn't loadngCookiesmodule in your app