-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
34 lines (34 loc) · 1.47 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// angular init/start
var App;
(function (App) {
// start up an angular module and the controllers
var app = angular.module('omscs-course-app', ['ngTable']);
var ser = new App.Serialization();
app.factory('updateService', function () {
return {
completedSelection: function (id) {
var completed = App.Cookies.parseCompletedCookies();
// force it to be number
id = parseInt(id.toString());
var idx = completed.indexOf(id);
if (idx > -1) {
completed.splice(idx, 1); // then remove
}
else {
completed.push(id); // then add
}
App.Cookies.updateCompletedCookies(completed);
ser.updateCompletedList(completed);
}
};
});
app.run(function ($rootScope, updateService) {
$rootScope.omsapp = updateService;
});
app.controller('courselistcontroller', function ($scope, NgTableParams) { return new App.CourseListController($scope, NgTableParams); });
app.controller('coursematrixcontroller', function ($scope, NgTableParams) { return new App.CourseMatrixController($scope, NgTableParams); });
app.controller('speclistcontroller', function ($scope, NgTableParams) { return new App.SpecListController($scope, NgTableParams); });
ser.loadCourses();
ser.loadSpecializations();
})(App || (App = {}));
//# sourceMappingURL=app.js.map