Skip to content

Commit 14c04de

Browse files
author
András Németh
committed
Organisation der Angular Dateien anpassen
1 parent f398b2d commit 14c04de

File tree

5 files changed

+90
-96
lines changed

5 files changed

+90
-96
lines changed

index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131

3232
<!-- AngularJS base and data scripts -->
3333
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
34-
<script src="js-angular/webApp.js"></script>
35-
<script src="js-angular/eventController.js"></script>
34+
<script src="js/angular/webApp.js"></script>
35+
<script src="js/data/eventList.js"></script>
36+
<script src="js/angular/eventController.js"></script>
3637

3738
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
3839
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

js-data/events.json

Lines changed: 0 additions & 71 deletions
This file was deleted.
Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
11
app.controller('eventController', function($scope) {
22

3-
/*
4-
Expected structure for "eventList" entries:
5-
(Time values must be integers.)
6-
{
7-
"year" : 2000,
8-
"month" : 1,
9-
"day" : 1,
10-
"startHour" : 17,
11-
"startMin" : 0,
12-
"endHour" : 19,
13-
"endMin" : 0,
14-
"location" : "Raum",
15-
"isIntroEvent" : false
16-
}
17-
*/
18-
19-
$scope.eventList = null; // initialized in init
3+
$scope.eventList = eventList; // from global var in data script
204
$scope.pastEventList = []; // filled in init
215
$scope.nextEvent = null; // initialized in init
226
$scope.futureEventList = []; // filled in init
@@ -56,9 +40,7 @@ app.controller('eventController', function($scope) {
5640
}
5741
};
5842

59-
$scope.init = function(argEventList) {
60-
61-
$scope.eventList = argEventList;
43+
$scope.init = function() {
6244

6345
// fill split event lists
6446

@@ -92,8 +74,6 @@ app.controller('eventController', function($scope) {
9274

9375
};
9476

95-
$.getJSON("js-data/events.json", function (data) {
96-
$scope.init(data.eventList);
97-
});
77+
$scope.init();
9878

9979
});

js/data/eventList.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
eventList = [
2+
/*
3+
Expected structure for "eventList" entries:
4+
(Time values must be integers.)
5+
{
6+
"year" : 2000,
7+
"month" : 1,
8+
"day" : 1,
9+
"startHour" : 17,
10+
"startMin" : 0,
11+
"endHour" : 19,
12+
"endMin" : 0,
13+
"location" : "Raum",
14+
"isIntroEvent" : false
15+
}
16+
*/
17+
{
18+
"year" : 2016,
19+
"month" : 9,
20+
"day" : 16,
21+
"startHour" : 17,
22+
"startMin" : 0,
23+
"endHour" : 19,
24+
"endMin" : 0,
25+
"location" : "Seminarraum 236",
26+
"isIntroEvent" : true
27+
},
28+
{
29+
"year" : 2016,
30+
"month" : 9,
31+
"day" : 30,
32+
"startHour" : 17,
33+
"startMin" : 0,
34+
"endHour" : 19,
35+
"endMin" : 0,
36+
"location" : "Seminarraum 236",
37+
"isIntroEvent" : false
38+
},
39+
{
40+
"year" : 2016,
41+
"month" : 10,
42+
"day" : 14,
43+
"startHour" : 17,
44+
"startMin" : 0,
45+
"endHour" : 19,
46+
"endMin" : 0,
47+
"location" : "Seminarraum 236",
48+
"isIntroEvent" : false
49+
},
50+
{
51+
"year" : 2016,
52+
"month" : 10,
53+
"day" : 28,
54+
"startHour" : 17,
55+
"startMin" : 0,
56+
"endHour" : 19,
57+
"endMin" : 0,
58+
"location" : "Seminarraum 236",
59+
"isIntroEvent" : true
60+
},
61+
{
62+
"year" : 2016,
63+
"month" : 11,
64+
"day" : 11,
65+
"startHour" : 17,
66+
"startMin" : 0,
67+
"endHour" : 19,
68+
"endMin" : 0,
69+
"location" : "Seminarraum 236",
70+
"isIntroEvent" : false
71+
},
72+
{
73+
"year" : 2016,
74+
"month" : 11,
75+
"day" : 25,
76+
"startHour" : 17,
77+
"startMin" : 0,
78+
"endHour" : 19,
79+
"endMin" : 0,
80+
"location" : "Seminarraum 236",
81+
"isIntroEvent" : true
82+
}
83+
84+
];

0 commit comments

Comments
 (0)