Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Atle Haugan committed Mar 16, 2016
1 parent 9e7fd2f commit c02db67
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
10 changes: 1 addition & 9 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,7 @@ app.get('/api/events', function (requestFromClient, responseToClient) {
});

responseFromEventServer.on('end', function () {
var eventListing = JSON.parse(body);
var events = eventListing.events.map(function(event){
return {
name: event.name,
startsAt: event.occurrence.dateFrom,
venue: event.venue.name
};
});
responseToClient.send(events);
responseToClient.send(JSON.parse(body));
});
});
requestFromClient.end();
Expand Down
15 changes: 2 additions & 13 deletions client/app.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
var app = angular.module('myApp', []);

app.controller('myCtrl', function($scope, $http) {
$scope.event ='test2';
$scope.events = [
{"name": "Trønderkaillan", "startsAt": "2016-03-17T14:00+01:00", "venue": "Levanger bibliotek"},
{"name": "TSO: Missa Solemnis", "startsAt": "2016-03-17T19:30+01:00", "venue": "Olavshallen"},
{"name": "Zap Mama", "startsAt": "2016-03-17T20:00+01:00", "venue": "Dokkhuset"},
{"name": "Vinterfestspill i Bergstaden", "startsAt": "2016-03-17T20:30+01:00", "venue": "Storstuggu"},
{"name": "Anne Lene Hagglund m band", "startsAt": "2016-03-17T21:00+01:00", "venue": "Moskus"},
{"name": "Luftforsvarets musikkorps: Påskerebus", "startsAt": "2016-03-18T12:00+01:00", "venue": "Byscenen"},
{"name": "Stabat Mater av G. Pergolesi", "startsAt": "2016-03-18T18:00+01:00", "venue": "Birgittaklosteret i Trondheim"},
{"name": "Drivhuset minifestival", "startsAt": "2016-03-18T18:00+01:00", "venue": "BrukBar/Blæst"},
{"name": "William Hut", "startsAt": "2016-03-18T20:00+01:00", "venue": "Antikvariatet"},
{"name": "Young Fogertys", "startsAt": "2016-03-18T20:00+01:00", "venue": "Mellomveien Bar"}];
$http.get("/api/events")
.then(function(response) {
$scope.serverEvents = response.data;
$scope.events = response.data.events;
});
});
4 changes: 2 additions & 2 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<div class="jumbotron">
<h1>Whatsup?</h1>
</div>
<div class="row" ng-repeat="e in serverEvents">
<div class="row" ng-repeat="e in events">
<div class="col-*-*">
<h3>{{e.name}}</h3>
<p>{{e.venue}}, {{e.startsAt | date:'EEEE, dd MMMM HH:mm'}}</p>
<p>{{e.venue.name}}, {{e.occurrence.dateFrom | date:'EEEE, dd MMMM HH:mm'}}</p>
</div>
</div>
</div>
Expand Down

0 comments on commit c02db67

Please sign in to comment.