0
Click here to see error message
遇到錯誤$注射器:unpr未知提供商爲$餅乾
我加入了ngcookies模塊在我的app.js文件,然後使用當Cookie服務在我的控制器注入在我的控制器$ cookie的服務,但我不能創建一個cookie 拋出錯誤
app.js
個controller.js
var app = angular.module('advogeApp');
app.controller('SigninCtrl', ['$scope', '$http', '$cookies', '$location', function($scope, $http, $cookies, $location) {$scope.loginData = function() {
angular.element('#signin').modal("hide");
$http({
method : 'POST',
url : '/proxy/',
headers: {'Content-Type': 'application/json', 'endpoint' : '/login/'},
data : JSON.stringify({email : $scope.userEmail, password : $scope.userPwd}),
}).then(function(response){
$cookies.put('set-cookie', response.data.headers['set-cookie']);
if (response.data.body.info == "sucessfully logged in") {
$location.path('/dashboard');
} else {
$scope.logininfo = response.data.info;
console.log(response.data);
}
},function(response){
console.log(response);
});
請幫助解決售後服務這個錯誤
可以ü告訴任何遺漏注射 – jayanthanantharapu
看我的代碼和你之間的差異性,我剛纔說的:'「$ httpProvider」,「$ cookies'' –
@stevee Pitis同樣的錯誤來了 – jayanthanantharapu