I connect ngCookies

//app.js var app = angular.module('myApp', [ 'ngRoute', 'ngCookies', 'myApp.script', ]); //script.js angular.module('myApp.script', []) .controller('MainCtrl', [ '$http', '$scope', '$cookies', function ($scope, $http, $cookies) { $scope.cookieUser = $cookies.get('username'); }]); 

I get an error

Uncaught Error: [$ injector: modulerr]

What's wrong?

    1 answer 1

    The problem was that I forgot to connect in the html file angular-cookies.js as it is here