-
Notifications
You must be signed in to change notification settings - Fork 0
/
lump.js
41 lines (38 loc) · 993 Bytes
/
lump.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
angular.module('whatisthislump', ['ngRoute', 'firebase'])
.controller('lumpCtrl', function($scope){
console.log("initiating lumpCtrl...");
$scope.lumps = [
{
"patient": "bob",
"src": "knee-lump.jpg",
"symptoms": ["painful", "swelling"]
},
{
"patient": "alice",
"src": "neck-lump.jpg",
"symptoms": ["infected", "green"]
}
];
var counter = -1;
$scope.lump = $scope.lumps[counter];
$scope.next = function(){
// load next lump.
console.log("load new lump.");
counter++;
$scope.lump = $scope.lumps[counter];
};
$scope.benign = function(){
// increment benign votes.
console.log("increment benign votes.");
lump.benign++;
lump.save();
$scope.next();
};
$scope.malignant = function(){
console.log("increment malignant votes.");
lump.malignant++;
lump.save();
$scope.next();
};
$scope.next();
});