mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-17 21:29:13 +00:00
Added frontend pages and trying to model wrestlers on frontend
This commit is contained in:
19
frontend/app/js/models/wrestler.js
Normal file
19
frontend/app/js/models/wrestler.js
Normal file
@@ -0,0 +1,19 @@
|
||||
'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;
|
||||
});
|
||||
Reference in New Issue
Block a user