Skip to content

Instantly share code, notes, and snippets.

@fnk0
Created August 12, 2014 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fnk0/b3647bf64120d36dbb6f to your computer and use it in GitHub Desktop.
Save fnk0/b3647bf64120d36dbb6f to your computer and use it in GitHub Desktop.
app.controller('WorkbenchController', ['$http', function($http){
var workbenches = this;
workbenches.computers = [];
workbenches.getWorkbenchName = function(workbenchNumber) {
switch(workbenchNumber) {
case 1:
return "Workbench #1";
case 2:
return "Workbench #2";
case 3:
return "Workbench #3";
case 4:
return "Workbench #4";
case 5:
return "Laptop Workbench";
case 6:
return "Daniel's Desk";
case 7:
return "Dustin's Desk";
case 8:
return "Mac Workbench";
case 9:
return "Workroom Shelf";
case 10:
return "Finished Room";
}
return "";
}
// Request the computers
// Each of them has an object that has a computer
$http.get('/api/computer').success(function(data) {
workbenches.computers = data.computers;
});
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment