Created
August 12, 2014 18:15
-
-
Save fnk0/b3647bf64120d36dbb6f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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