Ich habe ein Problem, dass ich nicht sehe, meine Konsole Protokoll überhaupt und ich möchte wissen, ob eine Räude, um den Cookie in meinem Controller eingeben, die ich in meiner HTML-Seite habe.Konsole loggen Winkel
var addPartyApp = angular.module('addPartyApp',['ngCookies']);
addPartyApp.controller('partyController',['$scope','$http', '$cookies', function($scope,$http,$cookies){
console.log("works!");
// $scope.createParty = function(){
var data = {};
data.title = $scope.title;
data.description = $scope.description;
data.image = $scope.myFile;
data.email = $scope.cookie;
console.log($scope.cookie);
console.log($scope.myFile);
console.log(data);
$http.post('http://localhost:3000/party', data).then() //callback
//}
}]);
Ich möchte wirklich wissen, was das Problem ist, weil ich Konsole viel log verwenden und ohne sie ist es wirklich schwer für meine mich
dank überprüfen!
die html
<!DOCTYPE html>
<html ng-app="addPartyApp">
<head>
<title>show party</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css">
</head>
<body ng-controller="partyController">
<h1 class="text-center">Add Party</h1>
<form class="form-group" enctype="multipart/form-data" method="POST" action="http://localhost:3000/party">
<div class="form-group">
<div class="col-sm-10">
<label for="inputEmail3" class="col-sm-2 control-label">Title:</label>
<input class="form-control" type="text" placeholder="Title" ng-model="title" name="title" required></input>
</div>
<div class="col-sm-10">
<label for="inputEmail3" class="col-sm-2 control-label">Description:</label>
<textarea class="form-control" id="inputEmail3" type="text" placeholder="Description" ng-model="description" name="description" required></textarea>
<br>
</div>
<div class="col-sm-10">
<br>
<input type="file" name="file" accept="image/*" required></input>
</div>
<div class="col-sm-10">
<br>
<input type="submit" class="btn btn-default" name="send"></input>
</div>
</div>
</form>
<script src="js/lib/angular/angular.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-resource.js"></script>
<script src="js/addParty.js"></script>
</body>
</html>
es hinzuzufügen vergessen, nachdem ein um es zu löschen versucht, weil es nicht funktioniert hat und ich, obwohl die Cookies sind das Problem - arbeiten :( – user3488862