Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions client/app/events/components/events.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const events = {
.then(function(res) {
// Store array of JSON events.
ctrl.events = res.data;
console.log(ctrl.events);
})
.then(function(data, status) {
console.log('Data: ', data);
Expand All @@ -25,14 +24,25 @@ const events = {
{{ $ctrl.events[0].place.location.state }} {{ $ctrl.events[0].place.location.zip }}
</h4>
<div>
<section ng-repeat="(key, value) in $ctrl.events">
<section ng-repeat="(key, value) in $ctrl.events" ng-if='value.start_time > "value.start_time" ' >
<div><b>{{ value.name }}</b></div>
<div>Time: {{ value.start_time }} - {{ value.end_time }}</div>
<span>{{ value.start_time | date:"MM/dd/yyyy 'at' h:mma"}}</span> - <span>{{ value.end_time | date:"MM/dd/yyyy 'at' h:mma"}}</span><br>
<div>Description: {{ value.description }}</div>
<hr/>
</section>
</div>
<div ng-else>
<h2> Send us an email to schedule an event </h2>
<a href="mailto:info@40weightcoffee.com" target="_blank"><img src="images/email.png" alt="email"></a>
</div>
`
};

angular.module('5340-site.events').component('events', events);







5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
"body-parser": "^1.17.2",
"bootstrap": "3.3.7",
"colors": "^1.1.2",
"express": "^4.15.3",
"express": "^4.16.2",
"jquery": "^3.2.1",
"mongoose": "^4.10.0",
"morgan": "^1.8.1",
"request": "^2.81.0"
"request": "^2.81.0",
"yarn": "^1.3.2"
},
"devDependencies": {
"babel-core": "^6.26.0",
Expand Down
3 changes: 2 additions & 1 deletion server/controllers/eventsCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ module.exports = {

request(url, (err, response, body) => {
if(!err && response.statusCode == 200) {
res.json((JSON.parse(body)).data);
res.json((JSON.parse(body)).data);
} else {
console.log("ERROR: ", err);
}
});
}
};

10 changes: 5 additions & 5 deletions server/controllers/menuCtrl.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var menu = require('../data/menu.json');

module.exports = {
// get things from the json file
get: (req, res) => {
res.json(menu);
}
};
// get things from the json file
get: (req, res) => {
res.json(menu);
}
};