Fixes for minification of controllers.

This commit is contained in:
Dorian 2013-07-29 08:07:40 -04:00
parent 76233fec2a
commit ecd21e050b
1 changed files with 57 additions and 58 deletions

View File

@ -11,86 +11,85 @@
// TODO Make this a bit more AngularJS module looking... // TODO Make this a bit more AngularJS module looking...
// Controls the task list. // Controls the task list.
TaskListController.$inject = ['$scope', 'Task']; rookeriesApp.controller(
"TaskListController", ['$scope', 'Task', function ($scope, Task) {
function TaskListController($scope, Task) { $scope.tasks = Task.query();
$scope.tasks = Task.query(); $scope.orderProp = 'id';
$scope.orderProp = 'id';
// TODO Build this out properly. // TODO Build this out properly.
$scope.popup = function(task) { $scope.popup = function(task) {
alert("I am task #" + task.id); alert("I am task #" + task.id);
} }
} }]);
// Control the detailed view of a task. // Control the detailed view of a task.
TaskDetailController.$inject = ['$scope', '$routeParams', 'Task']; rookeriesApp.controller(
"TaskDetailController", ['$scope', '$stateParams', 'Task', function ($scope, $stateParams, Task) {
function TaskDetailController($scope, $stateParams, Task) { $scope.task = Task.get(
$scope.task = Task.get( {taskId: $stateParams.taskId}, function($scope, $stateParams, task) {
{taskId: $stateParams.taskId}, function($scope, $stateParams, task) {
$scope.task = task.task;
$scope.id = $stateParams.taskId;
});
}]);
$scope.task = task.task;
$scope.id = $stateParams.taskId;
});
}
// TODO Clean up experimental code... // TODO Clean up experimental code...
ModalDemoCtrl = function ($scope) { rookeriesApp.controller(
"ModalDemoCtrl", ["$scope", function ($scope) {
$scope.open = function () { $scope.open = function () {
$scope.shouldBeOpen = true; $scope.shouldBeOpen = true;
}; };
$scope.close = function () { $scope.close = function () {
$scope.closeMsg = 'I was closed at: ' + new Date(); $scope.closeMsg = 'I was closed at: ' + new Date();
$scope.shouldBeOpen = false; $scope.shouldBeOpen = false;
}; };
$scope.items = ['item1', 'item2']; $scope.items = ['item1', 'item2'];
$scope.opts = { $scope.opts = {
backdropFade: true, backdropFade: true,
dialogFade:true dialogFade:true
}; };
}]);
};
// Setup of document pages. // Setup of document pages.
DocPageController.$inject = ['$scope', '$stateParams', 'DocPage']; rookeriesApp.controller(
function DocPageController($scope, $stateParams, DocPage) { "DocPageController", ['$scope', '$stateParams', 'DocPage', function ($scope, $stateParams, DocPage) {
// $scope.docPage = $stateParams; $scope.docPage = DocPage.get({page: $stateParams.page});
$scope.docPage = DocPage.get({page: $stateParams.page});
}
SwitchThemeCtrl.$inject = ['$scope']; }]);
// Based off : http://stackoverflow.com/questions/16514330/angularjs-switch-stylesheets-based-on-user-input
// Toggle between themes. // Toggle between themes.
function SwitchThemeCtrl($scope) { // Based off : http://stackoverflow.com/questions/16514330/angularjs-switch-stylesheets-based-on-user-input
rookeriesApp.controller(
// TODO Consider having an array of themes and switching to the next with a faux-pointer? "SwitchThemeCtrl", ['$scope', function ($scope) {
// TODO Turn the user preferences into a nice model.
$scope.user_pref_theme = "daytime";
$scope.user_pref_alternative_theme = "evening";
$scope.user_pref_theme_icon_colour = " "; // TODO Consider having an array of themes and switching to the next with a faux-pointer?
$scope.switchTheme = function() { // TODO Turn the user preferences into a nice model.
$scope.user_pref_theme = "daytime";
$scope.user_pref_alternative_theme = "evening";
if ($scope.user_pref_theme === "daytime") { $scope.user_pref_theme_icon_colour = " ";
$scope.user_pref_theme = "evening"; $scope.switchTheme = function() {
$scope.user_pref_alternative_theme = "daytime";
$scope.user_pref_theme_icon_colour = "icon-white";
} else {
$scope.user_pref_theme = "daytime";
$scope.user_pref_alternative_theme = "evening";
$scope.user_pref_theme_icon_colour = " ";
}
}
}
if ($scope.user_pref_theme === "daytime") {
$scope.user_pref_theme = "evening";
$scope.user_pref_alternative_theme = "daytime";
$scope.user_pref_theme_icon_colour = "icon-white";
} else {
$scope.user_pref_theme = "daytime";
$scope.user_pref_alternative_theme = "evening";
$scope.user_pref_theme_icon_colour = " ";
}
}
}]);
//function NavMenuCtrl($scope, DocPage) { //function NavMenuCtrl($scope, DocPage) {
// //