0

Подключаю 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');
}]);

Получаю ошибку

Uncaught Error: [$injector:modulerr]

Что не так?

1 ответ 1

0

Проблема была в том, что я забыл подключить в html файле angular-cookies.js как это скзанно тут

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.