angular.module('tools', ['resources.projects', 'resources.tasks'])
.config(['$routeProvider', function ($routeProvider) {
  $routeProvider.when('/tools', {
    templateUrl:'tools/tools.tpl.html',
    controller:'ToolsCtrl',
    resolve:{
      projects:['Projects', function (Projects) {
        //TODO: need to know the current user here
        return Projects.all();
      }],
      tasks:['Tasks', function (Tasks) {
        //TODO: need to know the current user here
        return Tasks.all();
      }]
    }
  });
}])

.controller('ToolsCtrl', ['$scope', '$location', 'projects', 'tasks', 'genModelService', function ($scope, $location, projects, tasks, genModelService) {
  $scope.projects = projects;
  $scope.tasks = tasks;

  $scope.items = genModelService.toolsItems;

}]);

