I've defined two collections in Angular:
app.controller('MainCtrl', function($scope, PieceService, TeamService) {
PieceService.query(function(data){
$scope.pieces = data;
});
TeamService.query(function(data){
$scope.teams = data;
});
});
pieces is a collection that looks like this: [{name:'Petra',team_id:2},{name:'Jan',team_id:3}]
team is a collection that looks like this: [{name:'TeamA',id:2},{name:'Team',id:3}]
In the template I am iterating over the pieces collection:
<tr data-ng-repeat="piece in pieces">
How can I print the teamname of each piece?
I've tried creating a filter that does this, but as I don't see how I can access the scope in a filter I'm without luck so far.