I am experiencing an issue where I cannot see any console logs and I'm unsure if the cookie is being entered into my controller from the HTML page.
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
//}
}]);
I really need assistance in resolving this problem as I heavily rely on console logging for debugging purposes.
Thank you!
Here is the HTML code:
<!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>