Skip to content

Commit 75b1246

Browse files
committed
merged from master
2 parents b90cf1d + e1a31b1 commit 75b1246

File tree

10 files changed

+55
-687
lines changed

10 files changed

+55
-687
lines changed

main/lessons/lessonsContentController.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ angular.module('myApp')
33
.controller('lessonsContentController', function($scope, lessonsContentService) {
44

55
$scope.lessonInfo = (input) => {
6-
// lessonConten to return object?
7-
let lessonContent = lessonsContentService.getLessonInfo(input);
8-
// console.log(lessonContent.questions);
6+
let lessonContent = lessonsContentService.getLessonInfo(input).then(function(lesson) {
7+
console.log(lesson.data[0]);
8+
})
9+
// $scope.theTitle = lessonContent;
910
$scope.testObject = lessonContent;
1011

1112
let testLength = lessonContent.questions.length,
@@ -29,8 +30,6 @@ angular.module('myApp')
2930
// console.log($(selected).siblings('button'));
3031
// console.log(selected.value);
3132
// console.log(selected.name);
32-
33-
3433
})
3534
}
3635

main/lessons/lessonsContentService.js

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
angular.module('myApp')
22

3-
.service('lessonsContentService', function() {
3+
.service('lessonsContentService', function($http) {
44

5-
let jsDataTypes = 'Data Types',
6-
jsVariables = 'Variables',
7-
jsStrings = 'Strings',
8-
jsConditional = 'Conditional Operators',
9-
jsArrays = "Arrays",
10-
jsObjects = 'Objects',
11-
jsIterators = 'Iterators',
12-
jsLogical = 'Logical Operators',
13-
jsFunctions = 'Functions';
145

156
let dummyData = {
167
"name": "Data Types",
@@ -35,37 +26,10 @@ angular.module('myApp')
3526
};
3627

3728
this.getLessonInfo = (input) => {
38-
switch (input) {
39-
case 'js-lesson-data-types':
40-
return dummyData;
41-
// break;
42-
case 'js-lesson-variables':
43-
return jsVariables;
44-
// break;
45-
case 'js-lesson-strings-cont':
46-
return jsStrings;
47-
// break;
48-
case 'js-lesson-conditional':
49-
return jsConditional;
50-
// break;
51-
case 'js-lesson-arrays':
52-
return jsArrays;
53-
// break;
54-
case 'js-lesson-objects':
55-
return jsObjects;
56-
// break;
57-
case 'js-lesson-iterators':
58-
return jsIterators;
59-
// break;
60-
case 'js-lesson-logical':
61-
return jsLogical;
62-
// break;
63-
case 'js-lesson-functions':
64-
return jsFunctions;
65-
// break;
66-
default:
67-
break;
68-
}
29+
return $http ({
30+
method: 'GET',
31+
url: '/api/lessons/js/' + input
32+
})
6933
}
7034

7135

main/lessons/lessonsContentTemplate.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
</div> -->
44

55
<div class="lesson-tests-wrapper">
6-
76
<section class="lessonTests" lesson-tests-directive>
87
<form method="POST">
98
<h2>JavaScript<br>{{title}}<br>Test</h2>

main/lessons/lessonsSideBarTemplate.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<section class="lessons-wrapper">
55
<div class="lessons">
66

7-
<div id="js-lesson-data-types" ng-click="lessonInfo('js-lesson-data-types')">
7+
<div id="js-lesson-data-types" ng-click="lessonInfo('Data Types')">
88
<!-- <h3 class="lesson-group">Lesson 1</h3> -->
99
<h3 class="lesson-title">Data Types</h3>
1010
<!-- <ul class="lesson-title"><h3></h3> -->
@@ -23,7 +23,7 @@ <h4 class="lesson-test">Test</h4>
2323
</ul>
2424
</div>
2525

26-
<div id="js-lesson-variables" ng-click="lessonInfo('js-lesson-variables')">
26+
<div id="js-lesson-variables" ng-click="lessonInfo('Variables')">
2727
<!-- <h3 class="lesson-group">Lesson 3</h3> -->
2828
<h3 class="lesson-title">Variables</h3>
2929
<!-- <ul class="lesson-title"><h3>Numbers</h3> -->
@@ -41,7 +41,7 @@ <h4 class="lesson-test">Test</h4>
4141
</ul>
4242
</div>
4343

44-
<div id="js-lesson-strings-cont" ng-click="lessonInfo('js-lesson-strings-cont')">
44+
<div id="js-lesson-strings-cont" ng-click="lessonInfo('Strings Cont')">
4545
<!-- <h3 class="lesson-group">Lesson 2</h3> -->
4646
<h3 class="lesson-title">Strings Continued</h3>
4747
<!-- <ul class="lesson-title"><h3>Strings</h3> -->
@@ -64,7 +64,7 @@ <h4 class="lesson-test">Test</h4>
6464
</ul>
6565
</div>
6666

67-
<div id="js-lesson-conditional" ng-click="lessonInfo('js-lesson-conditional')">
67+
<div id="js-lesson-conditional" ng-click="lessonInfo('Conditional Operators')">
6868
<!-- <h3 class="lesson-group">Lesson 4</h3> -->
6969
<h3 class="lesson-title">Conditional Operators</h3>
7070
<!-- <ul class="lesson-title"><h3>Conditional Operators</h3> -->
@@ -83,7 +83,7 @@ <h4 class="lesson-test">Test</h4>
8383
</ul>
8484
</div>
8585

86-
<div id="js-lesson-arrays" ng-click="lessonInfo('js-lesson-arrays')">
86+
<div id="js-lesson-arrays" ng-click="lessonInfo('Arrays')">
8787
<!-- <h3 class="lesson-group">Lesson 6</h3> -->
8888
<h3 class="lesson-title">Arrays</h3>
8989
<!-- <ul class="lesson-title"><h3>Arrays</h3> -->
@@ -109,7 +109,7 @@ <h4 class="lesson-test">Test</h4>
109109
</ul>
110110
</div>
111111

112-
<div id="js-lesson-objects" ng-click="lessonInfo('js-lesson-objects')">
112+
<div id="js-lesson-objects" ng-click="lessonInfo('Objects')">
113113
<!-- <h3 class="lesson-group">Lesson 5</h3> -->
114114
<h3 class="lesson-title">Objects</h3>
115115
<!-- <ul class="lesson-title"><h3>Objects</h3> -->
@@ -132,7 +132,7 @@ <h4 class="lesson-test">Test</h4>
132132
</ul>
133133
</div>
134134

135-
<div id="js-lesson-iterators" ng-click="lessonInfo('js-lesson-iterators')">
135+
<div id="js-lesson-iterators" ng-click="lessonInfo('Iterators')">
136136
<!-- <h3 class="lesson-group">Lesson 7</h3> -->
137137
<h3 class="lesson-title">Iterators</h3>
138138
<!-- <ul class="lesson-title"><h3>Iterators</h3> -->
@@ -151,7 +151,7 @@ <h4 class="lesson-test">Test</h4>
151151
</ul>
152152
</div>
153153

154-
<div id="js-lesson-logical" ng-click="lessonInfo('js-lesson-logical')">
154+
<div id="js-lesson-logical" ng-click="lessonInfo('Logical Operators')">
155155
<!-- <h3 class="lesson-group">Lesson 8</h3> -->
156156
<h3 class="lesson-title">Logical Operators</h3>
157157
<!-- <ul class="lesson-title"><h3>Logical Operators</h3> -->
@@ -169,7 +169,7 @@ <h4 class="lesson-test">Test</h4>
169169
</ul>
170170
</div>
171171

172-
<div id="js-lesson-functions" ng-click="lessonInfo('js-lesson-functions')">
172+
<div id="js-lesson-functions" ng-click="lessonInfo('Functions')">
173173
<!-- <h3 class="lesson-group">Lesson 9</h3> -->
174174
<h3 class="lesson-title">Functions</h3>
175175
<!-- <ul class="lesson-title"><h3>Functions</h3> -->

0 commit comments

Comments
 (0)