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,9 +11,9 @@
// TODO Make this a bit more AngularJS module looking...
// 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.orderProp = 'id';
@ -21,21 +21,23 @@ function TaskListController($scope, Task) {
$scope.popup = function(task) {
alert("I am task #" + task.id);
}
}
}]);
// 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(
{taskId: $stateParams.taskId}, function($scope, $stateParams, task) {
$scope.task = task.task;
$scope.id = $stateParams.taskId;
});
}
}]);
// TODO Clean up experimental code...
ModalDemoCtrl = function ($scope) {
rookeriesApp.controller(
"ModalDemoCtrl", ["$scope", function ($scope) {
$scope.open = function () {
$scope.shouldBeOpen = true;
@ -52,22 +54,21 @@ ModalDemoCtrl = function ($scope) {
backdropFade: true,
dialogFade:true
};
};
}]);
// Setup of document pages.
DocPageController.$inject = ['$scope', '$stateParams', 'DocPage'];
function DocPageController($scope, $stateParams, DocPage) {
rookeriesApp.controller(
"DocPageController", ['$scope', '$stateParams', 'DocPage', function ($scope, $stateParams, DocPage) {
// $scope.docPage = $stateParams;
$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.
function SwitchThemeCtrl($scope) {
// Based off : http://stackoverflow.com/questions/16514330/angularjs-switch-stylesheets-based-on-user-input
rookeriesApp.controller(
"SwitchThemeCtrl", ['$scope', function ($scope) {
// TODO Consider having an array of themes and switching to the next with a faux-pointer?
// TODO Turn the user preferences into a nice model.
@ -88,9 +89,7 @@ function SwitchThemeCtrl($scope) {
}
}
}
}]);
//function NavMenuCtrl($scope, DocPage) {
//