Skip to content

Commit d7f4868

Browse files
committed
fix the bug - the problem was on html
Uncaught Error: [$injector:modulerr] Failed to instantiate module BreakTheCode due to: Error: [$injector:nomod] Module 'BreakTheCode' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
1 parent 3c08ab0 commit d7f4868

17 files changed

+64
-74
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,8 @@ CREATE TABLE Answer(
8989
serialNumber int,
9090
duration double precision,
9191
timestamp timestamp default current_timestamp
92-
);
92+
);
93+
--------------------------------
94+
restart in server:
95+
pm2 list
96+
pm2 restart start_server

app/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ define([
55
'angularCookies',
66
'checklistModel'
77
], function() {
8-
angular.module('BreakTheCode', ['ngRoute','ngResource', 'ngCookies', 'timer', 'checklist-model']);
8+
return angular.module('BreakTheCode', ['ngRoute','ngResource', 'ngCookies', 'timer', 'checklist-model']);
99
});
1010

app/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<html ng-app="BreakTheCode">
1+
<html>
22
<head>
33
<title>Get the code?</title>
44
<!-- Css -->

app/login/loginController.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
define([
2-
'angular',
32
'../app',
3+
'angular',
44
'../service/questionService',
55
'../service/userService',
66
'../utils/utils',
77
'text!./loginTemplate.html'
88
], function(app) {
9-
angular.module('BreakTheCode').
10-
controller('LoginController', ['$scope', '$location', 'UserService', 'QuestionService',
9+
app.controller('LoginController', ['$scope', '$location', 'UserService', 'QuestionService',
1110
function($scope, $location, UserService, QuestionService) {
1211
var self = this;
1312
$scope.user = {};

app/questionSummary/summaryController.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
define([
2+
'../app',
23
'JsDiff',
34
'angular',
4-
'../app',
55
'../service/questionService',
66
'../service/answerService'
7-
], function(JsDiff) {
8-
angular.module('BreakTheCode')
9-
.controller('SummaryController', ['$scope', '$rootScope', '$location', '$http', '$sce', 'QuestionService', 'AnswerService',
7+
], function(app, JsDiff) {
8+
app.controller('SummaryController', ['$scope', '$rootScope', '$location', '$http', '$sce', 'QuestionService', 'AnswerService',
109
function($scope, $rootScope, $location, $http, $sce, QuestionService, AnswerService) {
1110

1211
$scope.$on('checkAnswer', function (event, args) {

app/questionSummary/summaryDirective.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
define([
2+
'../app',
23
'jquery',
34
'jqueryUi',
45
'angular',
5-
'../app',
66
'./summaryController',
77
'text!./summaryTemplate.html'
8-
], function($, $$) {
9-
angular.module('BreakTheCode')
10-
.directive('summary', function() {
8+
], function(app, $, $$) {
9+
app.directive('summary', function() {
1110
return {
1211
restrict: 'E',
1312
templateUrl: 'questionSummary/summaryTemplate.html',

app/questions/answerAreaController.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
define([
2+
'../app',
23
'angular',
3-
'../app',
44
'../service/questionService',
55
'../service/answerService'
66
], function(app) {
7-
angular.module('BreakTheCode')
8-
.controller('answerAreaController', ['$scope', '$rootScope', '$location', '$http', '$sce', 'QuestionService', 'AnswerService',
7+
app.controller('answerAreaController', ['$scope', '$rootScope', '$location', '$http', '$sce', 'QuestionService', 'AnswerService',
98
function($scope, $rootScope, $location, $http, $sce, QuestionService, AnswerService) {
109

1110

app/questions/answerAreaDirective.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
define([
2-
'angular',
32
'../app',
3+
'angular',
44
'./answerAreaController',
55
'text!./answerAreaTemplate.html'
66
], function(app) {
7-
angular.module('BreakTheCode')
8-
.directive('answerArea', function() {
7+
app.directive('answerArea', function() {
98
return {
109
restrict: 'E',
1110
templateUrl: 'questions/answerAreaTemplate.html',
@@ -17,4 +16,4 @@ angular.module('BreakTheCode')
1716
}
1817
};
1918
});
20-
});
19+
});

app/questions/codeAreaDirective.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
define([
2+
'../app',
23
'jquery',
34
'codemirror',
4-
'angular',
5-
'../app',
5+
'angular',
66
'text!./codeAreaTemplate.html'
7-
], function($, CodeMirror) {
8-
angular.module('BreakTheCode')
9-
.directive('codeArea', function() {
7+
], function(app, $, CodeMirror) {
8+
app.directive('codeArea', function() {
109
return {
1110
restrict: 'E',
1211
templateUrl: 'questions/codeAreaTemplate.html',
@@ -26,4 +25,4 @@ angular.module('BreakTheCode')
2625
}
2726
};
2827
});
29-
});
28+
});

app/questions/questionsController.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
define([
2+
'../app',
23
'angular',
34
'angularTimer',
4-
// 'humanizeDuration',
5-
// 'momentWithLocales',
6-
'../app',
75
'../service/questionService',
86
'../service/timerService',
97
'./answerAreaDirective',
108
'./codeAreaDirective',
119
'../questionSummary/summaryDirective'
1210

13-
], function() {
14-
angular.module('BreakTheCode')
15-
.controller('QuestionsController', ['$scope', '$location', '$http', '$sce', 'QuestionService', 'TimerService',
11+
], function(app) {
12+
app.controller('QuestionsController', ['$scope', '$location', '$http', '$sce', 'QuestionService', 'TimerService',
1613
function($scope, $location, $http, $sce, QuestionService, TimerService) {
1714

1815
$scope.finishQuestion = finishQuestion;

app/routes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
define([
2+
'./app',
23
'angular',
34
'angularRoute',
4-
'./app',
55
'login/loginController',
66
'questions/questionsController'
77
], function(app) {
8-
angular.module('BreakTheCode').config(function($routeProvider){
8+
app.config(function($routeProvider){
99
$routeProvider
1010
.when('/', {
1111
templateUrl: "/login/loginTemplate.html",

app/service/answerService.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
define([
2-
'angular',
32
'../app',
3+
'angular',
44
'./questionService',
55
'./userService',
66
'./timerService'
77
], function(app) {
8-
angular.module('BreakTheCode')
9-
.service('AnswerService', ['$http', '$q', 'QuestionService', 'UserService', 'TimerService',
8+
app.service('AnswerService', ['$http', '$q', 'QuestionService', 'UserService', 'TimerService',
109
function($http, $q, QuestionService, UserService, TimerService) {
1110
var AnswerService = {};
1211
var currentAnswer;

app/service/questionService.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
define([
2-
'angular',
32
'../app',
3+
'angular',
44
'./userService'
55
], function(app) {
6-
angular.module('BreakTheCode')
7-
.service('QuestionService', ['$http', '$q', 'UserService',
6+
app.service('QuestionService', ['$http', '$q', 'UserService',
87
function($http, $q, UserService) {
98
var questionService = {};
109
var currentQuestion;

app/service/scoreService.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
define([
2-
'angular',
3-
'../app'
2+
'../app',
3+
'angular'
44
], function(app) {
5-
angular.module('BreakTheCode')
6-
.service('ScoreService', ['$http',
5+
app.service('ScoreService', ['$http',
76
function($http) {
87
var ScoreService = {};
98

@@ -13,4 +12,4 @@ angular.module('BreakTheCode')
1312

1413
return ScoreService;
1514
}]);
16-
});
15+
});

app/service/timerService.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
define([
2-
'angular',
3-
'../app'
2+
'../app',
3+
'angular'
44
], function(app) {
5-
angular.module('BreakTheCode')
6-
.service('TimerService', ['$http', '$q',
5+
app.service('TimerService', ['$http', '$q',
76
function($http, $q) {
87
var TimerService = {};
98
var stopWatch;

app/service/userService.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
define([
2-
'angular',
3-
'../app'
2+
'../app',
3+
'angular'
44
], function(app) {
5-
angular.module('BreakTheCode')
6-
.service('UserService', ['$http', '$q',
5+
app.service('UserService', ['$http', '$q',
76
function($http, $q) {
87
var UserService = {};
98
var currentUser;

app/utils/utils.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
define([
2-
'angular',
3-
'../app'
2+
'../app',
3+
'angular'
44
], function(app) {
5-
angular.module('BreakTheCode').filter('range', function() {
6-
return function(input, min, max) {
7-
min = parseInt(min); //Make string input int
8-
max = parseInt(max);
9-
for (var i=min; i<max; i++)
10-
input.push(i);
11-
return input;
12-
};
13-
});
5+
app.filter('range', function() {
6+
return function(input, min, max) {
7+
min = parseInt(min); //Make string input int
8+
max = parseInt(max);
9+
for (var i=min; i<max; i++)
10+
input.push(i);
11+
return input;
12+
};
13+
});
1414

15-
angular.module('BreakTheCode').filter('disRange', function() {
16-
return function(input, max, min) {
17-
min = parseInt(min); //Make string input int
18-
max = parseInt(max);
19-
for (var i=max; i>=min; i--)
20-
input.push(i);
21-
return input;
22-
};
23-
});
15+
app.filter('disRange', function() {
16+
return function(input, max, min) {
17+
min = parseInt(min); //Make string input int
18+
max = parseInt(max);
19+
for (var i=max; i>=min; i--)
20+
input.push(i);
21+
return input;
22+
};
23+
});
2424
});

0 commit comments

Comments
 (0)