mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-07 06:54:16 +00:00
19 lines
402 B
JavaScript
19 lines
402 B
JavaScript
'use strict';
|
|
|
|
app.factory('Wrestler', function Wrestler(){
|
|
var vm = this;
|
|
|
|
|
|
vm.matches = function(matches,wrestler){
|
|
var givenWrestler = wrestler;
|
|
|
|
console.log(givenWrestler.id);
|
|
return _.filter(matches, function(match){
|
|
return match.w1 == givenWrestler.id || match.w2 == givenWrestler.id;
|
|
});
|
|
|
|
|
|
}
|
|
|
|
return vm;
|
|
}); |