使用ng-options angularjs显示选定的值

时间:2016-03-06 01:23:50

标签: angularjs

我试图遍历已经属于锦标赛的一组球队,并希望将它们作为预选值显示在选择框中。选择框中的团队来自与锦标赛团队有id关联的团队列表。我确定我做错了,因为不仅团队没有被选中,而且当我在其中一个下降中改变团队时,其他两个也填充相同的确切值。

我希望我的解释不是模糊的。感谢您的帮助。

<tbody>
    <tr ng-repeat="team in vm.selectedTournament.teams">

      <td width="130">
        <select name="team" class="form-control" ng-options="team2.name for team2 in vm.teams track by team2.teamid" ng-model="vm.editTeam">

      </td>
      <td>{{ vm.getPlayerName(team.player1).local.fullname }}<br>{{vm.getPlayerName(team.player2).local.fullname}}</td>
      <td class="statDetail">{{team.strength}}</td>
      <td class="statDetail">{{team.PWR}}</td>

    </tr>
  </tbody>

1 个答案:

答案 0 :(得分:1)

  

但是当我在其中一个下拉列表中更改团队时,其他两个也会填充相同的确切值

这是因为您对所有团队行使用相同的ng-model对象。 每个团队行都绑定到vm.editTeam

给你的团队的JSON作为样本,我可以帮助你在plunkr。你可以分叉这个:http://plnkr.co/edit/WVUkCn?p=preview

UPD:认为这就是你想要的:

(function(angular) {
  'use strict';
  angular.module('teamApp', [])
    .controller('teamController', ['$http', function($http) {
      var vm = this;
      
      vm.tour = {};
      vm.teams = [];
      vm.tourTeams = [];
      
      getTeams();
      fillTourTeams();
      
      function getTeam(id)
      {
        var result = '';
        vm.teams.forEach(function(team){
          if (team.teamid == id)
            result = team;
        });
        
        return result;
      }
      
      function fillTourTeams()
      {
        vm.tour.teams.forEach(function(team, i){
          vm.tourTeams[i] = getTeam(team.teamid);
        });
      }
      
      // --------------------------------------------------
      // LOADING data block
      // --------------------------------------------------
      // sets JSON data to vm.tour & vm.teams
      
      function getTeams()
      {
        vm.tour = {
    "_id" : "56da3700f57a19d92856971b",
    "hide" : false,
    "commissioner" : "5642a4fbf6cb4e0300912c26",
    "name" : "testtornament",
    "playoffs" : true,
    "playoffGames" : [],
    "games" : [],
    "teams" : [ 
        {
            "player2" : "5644d0d7ad80960300ea5347",
            "player1" : "569fa12fcd1cf1030053c876",
            "isselected" : true,
            "name" : "Anaheim Ducks",
            "league" : "NHL",
            "city" : "Anaheim, FL",
            "__v" : 0,
            "teamid" : 1,
            "wins" : 0,
            "PWR" : 0,
            "goalsFor" : 0,
            "goalsAgainst" : 0,
            "strength" : 0,
            "points" : 0,
            "regulationOvertimeWins" : 0,
            "gamesPlayed" : 0,
            "goalDifferential" : 0,
            "shootoutWins" : 0,
            "overtimeShootoutLosses" : 0,
            "shootoutLosses" : 0,
            "regulationLosses" : 0,
            "_id" : "56b91258f5ccff0300b8be26"
        }, 
        {
            "player2" : "564294d6556a120300047078",
            "player1" : "5661eb3455814e030034fd3a",
            "isselected" : true,
            "name" : "Arizona Coyotes",
            "league" : "NHL",
            "city" : "Glendale , AZ",
            "__v" : 0,
            "teamid" : 4,
            "wins" : 0,
            "PWR" : 0,
            "goalsFor" : 0,
            "goalsAgainst" : 0,
            "strength" : 0,
            "points" : 0,
            "regulationOvertimeWins" : 0,
            "gamesPlayed" : 0,
            "goalDifferential" : 0,
            "shootoutWins" : 0,
            "overtimeShootoutLosses" : 0,
            "shootoutLosses" : 0,
            "regulationLosses" : 0,
            "_id" : "56b912eff5ccff0300b8be27"
        }, 
        {
            "player2" : "5642a4fbf6cb4e0300912c26",
            "player1" : "564604ead0ffe80300ee3806",
            "isselected" : true,
            "name" : "Boston Bruins",
            "league" : "NHL",
            "city" : "Boston, MA",
            "__v" : 0,
            "teamid" : 2,
            "wins" : 0,
            "PWR" : 0,
            "goalsFor" : 0,
            "goalsAgainst" : 0,
            "strength" : 0,
            "points" : 0,
            "regulationOvertimeWins" : 0,
            "gamesPlayed" : 0,
            "goalDifferential" : 0,
            "shootoutWins" : 0,
            "overtimeShootoutLosses" : 0,
            "shootoutLosses" : 0,
            "regulationLosses" : 0,
            "_id" : "56b91348f5ccff0300b8be28"
        }, 
        {
            "player2" : "5694273f1012bf030046e5b7",
            "player1" : "5627f66b7146710300e9281f",
            "isselected" : true,
            "name" : "Buffalo Sabres",
            "league" : "NHL",
            "city" : "Buffalo, NY",
            "__v" : 0,
            "teamid" : 3,
            "wins" : 0,
            "PWR" : 0,
            "goalsFor" : 0,
            "goalsAgainst" : 0,
            "strength" : 0,
            "points" : 0,
            "regulationOvertimeWins" : 0,
            "gamesPlayed" : 0,
            "goalDifferential" : 0,
            "shootoutWins" : 0,
            "overtimeShootoutLosses" : 0,
            "shootoutLosses" : 0,
            "regulationLosses" : 0,
            "_id" : "56b91370f5ccff0300b8be29"
        }, 
        {
            "player2" : "564e460bf3ec410300e1d599",
            "player1" : "564f899642a34c0300a8e6a8",
            "isselected" : true,
            "name" : "Calgary Flames",
            "league" : "NHL",
            "city" : "Calgary, AB",
            "__v" : 0,
            "teamid" : 5,
            "wins" : 0,
            "PWR" : 0,
            "goalsFor" : 0,
            "goalsAgainst" : 0,
            "strength" : 0,
            "points" : 0,
            "regulationOvertimeWins" : 0,
            "gamesPlayed" : 0,
            "goalDifferential" : 0,
            "shootoutWins" : 0,
            "overtimeShootoutLosses" : 0,
            "shootoutLosses" : 0,
            "regulationLosses" : 0,
            "_id" : "56b913ccf5ccff0300b8be2a"
        }, 
        {
            "player2" : "56620a9559749f030064f9d8",
            "player1" : "56ba9add45e99567ba637502",
            "isselected" : true,
            "name" : "Carolina Hurricanes",
            "league" : "NHL",
            "city" : "Raleigh, NC",
            "__v" : 0,
            "teamid" : 6,
            "wins" : 0,
            "PWR" : 0,
            "goalsFor" : 0,
            "goalsAgainst" : 0,
            "strength" : 0,
            "points" : 0,
            "regulationOvertimeWins" : 0,
            "gamesPlayed" : 0,
            "goalDifferential" : 0,
            "shootoutWins" : 0,
            "overtimeShootoutLosses" : 0,
            "shootoutLosses" : 0,
            "regulationLosses" : 0,
            "_id" : "56b913fff5ccff0300b8be2b"
        }
    ],
    "__v" : 0
};
        vm.teams = [
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 1,
    "wins" : 0,
    "teamid" : 32,
    "league" : "IWC",
    "city" : "Czech Republic",
    "name" : "Team Czech Republic",
    "__v" : 0
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 3,
    "wins" : 0,
    "teamid" : 9,
    "__v" : 0,
    "city" : "Columbus, OH",
    "league" : "NHL",
    "name" : "Columbus Blue Jackets"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 6,
    "wins" : 0,
    "teamid" : 15,
    "__v" : 0,
    "city" : "Los Angeles, CA",
    "league" : "NHL",
    "name" : "Los Angeles Kings"
},
{ 
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 10,
    "wins" : 0,
    "teamid" : 16,
    "__v" : 0,
    "city" : "Nashville, TN",
    "league" : "NHL",
    "name" : "Nashville Predators"
},


{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 20,
    "wins" : 0,
    "teamid" : 20,
    "__v" : 0,
    "city" : "Philadelphia, PA",
    "league" : "NHL",
    "name" : "Philadelphia Flyers"
},


{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 10,
    "wins" : 0,
    "teamid" : 22,
    "__v" : 0,
    "city" : "Montreal, Quebec",
    "league" : "NHL",
    "name" : "Montréal Canadiens"
},


{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 8,
    "wins" : 0,
    "teamid" : 23,
    "__v" : 0,
    "city" : "Pittsburgh, PA",
    "league" : "NHL",
    "name" : "Pittsburgh Penguins"
},


{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 18,
    "wins" : 0,
    "teamid" : 27,
    "__v" : 0,
    "city" : "Toronto, Ontario",
    "league" : "NHL",
    "name" : "Toronto Maple Leafs"
},


{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 29,
    "__v" : 0,
    "city" : "Washington, DC",
    "league" : "NHL",
    "name" : "Washington Capitals"
},


{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 12,
    "wins" : 0,
    "teamid" : 30,
    "__v" : 0,
    "city" : "Winnipeg, Manitoba",
    "league" : "NHL",
    "name" : "Winnipeg Jets"
},


{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 13,
    "wins" : 0,
    "teamid" : 28,
    "__v" : 0,
    "city" : "Vancouver, British Columbia",
    "league" : "NHL",
    "name" : "Vancouver Canucks"
},

{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 14,
    "wins" : 0,
    "teamid" : 26,
    "__v" : 0,
    "city" : "Tampa, FL",
    "league" : "NHL",
    "name" : "Tampa Bay Lightning"
},


{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 15,
    "wins" : 0,
    "teamid" : 25,
    "__v" : 0,
    "city" : "St. Louis, MO",
    "league" : "NHL",
    "name" : "St. Louis Blues"
},


{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 16,
    "wins" : 0,
    "teamid" : 24,
    "__v" : 0,
    "city" : "San Jose, CA",
    "league" : "NHL",
    "name" : "San Jose Sharks"
},


{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 17,
    "wins" : 0,
    "teamid" : 21,
    "__v" : 0,
    "city" : "Ottawa, Ontario",
    "league" : "NHL",
    "name" : "Ottawa Senators"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 19,
    "__v" : 0,
    "city" : "New York, NY",
    "league" : "NHL",
    "name" : "New York Rangers"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 18,
    "__v" : 0,
    "city" : "Brooklyn, NY",
    "league" : "NHL",
    "name" : "New York Islanders"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 14,
    "__v" : 0,
    "city" : "St. Paul, MN",
    "league" : "NHL",
    "name" : "Minnesota Wild"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 17,
    "__v" : 0,
    "city" : "Newark, NJ",
    "league" : "NHL",
    "name" : "New Jersey Devils"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 13,
    "__v" : 0,
    "city" : "Detroit, MI",
    "league" : "NHL",
    "name" : "Detroit Red Wings"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 12,
    "__v" : 0,
    "city" : "Sunrise, FL",
    "league" : "NHL",
    "name" : "Florida Panthers"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 11,
    "__v" : 0,
    "city" : "Edmonton, AB",
    "league" : "NHL",
    "name" : "Edmonton Oilers"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 10,
    "__v" : 0,
    "city" : "Dallas, TX",
    "league" : "NHL",
    "name" : "Dallas Stars"
},
{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 8,
    "__v" : 0,
    "city" : "Denver, CO",
    "league" : "NHL",
    "name" : "Colorado Avalanche"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 7,
    "__v" : 0,
    "city" : "Chicago, IL",
    "league" : "NHL",
    "name" : "Chicago Blackhawks"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 11,
    "wins" : 0,
    "teamid" : 6,
    "__v" : 0,
    "city" : "Raleigh, NC",
    "league" : "NHL",
    "name" : "Carolina Hurricanes"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 40,
    "wins" : 0,
    "teamid" : 5,
    "__v" : 0,
    "city" : "Calgary, AB",
    "league" : "NHL",
    "name" : "Calgary Flames"
},
{
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 61,
    "wins" : 0,
    "teamid" : 4,
    "__v" : 0,
    "city" : "Glendale , AZ",
    "league" : "NHL",
    "name" : "Arizona Coyotes"
},
{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 51,
    "wins" : 0,
    "teamid" : 3,
    "__v" : 0,
    "city" : "Buffalo, NY",
    "league" : "NHL",
    "name" : "Buffalo Sabres"
},
{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 18,
    "wins" : 0,
    "teamid" : 2,
    "__v" : 0,
    "city" : "Boston, MA",
    "league" : "NHL",
    "name" : "Boston Bruins"
},
{
   
    "regulationLosses" : 0,
    "shootoutLosses" : 0,
    "overtimeShootoutLosses" : 0,
    "shootoutWins" : 0,
    "goalDifferential" : 0,
    "gamesPlayed" : 0,
    "regulationOvertimeWins" : 0,
    "points" : 0,
    "strength" : 0,
    "goalsAgainst" : 0,
    "goalsFor" : 0,
    "PWR" : 110,
    "wins" : 0,
    "teamid" : 1,
    "__v" : 0,
    "city" : "Anaheim, FL",
    "league" : "NHL",
    "name" : "Anaheim Ducks"
}
];
      }
      // --------------------------------------------------
      // LOADING data block end
      // --------------------------------------------------

    }]);
})(window.angular);
body
{
  padding: 20px;
}
<!doctype html>
<html lang="en">
<head>
  <title>Teams - AngularJS sample for ngRepeat/ngSelect</title>
  <meta charset="UTF-8">
  
  <!-- AngularJS -->
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular-animate.js"></script>
  <!-- Bootstrap -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" >
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" >
  
  <script src="script.js"></script>
  <link href="style.css" rel="stylesheet" type="text/css">
  
</head>
<body ng-app="teamApp">
  
  <div ng-controller="teamController as vm">
  
  <div class="panel panel-default">

    <div class="panel-heading">
      Teams ({{vm.teams.length}})
    </div>
    
    <table class="table table-hover">
      <thead><tr>
          <th>ID</th>
          <th>Team name</th>
          <th>Players</th>
          <th>ST</th>
          <th>PWR</th>
      </tr></thead>
      <tbody>
        <tr ng-repeat="team in vm.tour.teams">
          
          <td>{{vm.tourTeams[$index].teamid}}</td>
          <td>
            <select ng-options="team.name for team in vm.teams" ng-model="vm.tourTeams[$index]">
            </select>
          </td>
          <td>-</td>
          <td>{{vm.tourTeams[$index].strength}}</td>
          <td>{{vm.tourTeams[$index].PWR}}</td>
          
        </tr>
      </tbody>
    </table>
  </div>
  
</div>
</body>
</html>

plnkr中的相同代码:http://plnkr.co/edit/wslwQP?p=preview