我试图在用户选择游戏时加载玩家列表,但是我收到 Cannot read property 'id' of undefined at m.$scope.getPlayers (campaigns-players.js:104)
我在另一个页面上使用了类似的方法,但是它在这个页面上给了我这个错误,所以我不太确定这次我做错了什么。感谢您的帮助!
HTML;
<div class="card-body">
<div class="form-group">
<label class="col-md-3 col-form-label">List of Games</label>
<select class="form-control" id="gameList" ng-model="game" ng-change="getPlayers()">
<option ng-repeat="game in allGames" ng-value="{{game.id}}"> {{game.name}}</option>
</select>
</div>
<div class="form-group">
<label for="name">List of Players</label>
<select class="form-control" id="ccmonth" ng-model="selectedPlayer">
<option ng-repeat="player in players" ng-value="{{player.id}}"> {{player.name}}</option>
</select>
</div>
<div class="form-group">
<label class="col-md-3 col-form-label">Player Name</label>
<input type="text" class="form-control" id="entityNameUpdate" ng-model="entityNameUpdate">
</div>
<div class="form-group">
<label for="name">Which game player in?</label>
<select class="form-control" id="updatedGamePlayer" ng-model="updatedGame">
<option ng-repeat="updatedGame in allGames" ng-value="{{updatedGame.id}}"> {{updatedGame.name}}</option>
</select>
</div>
<div class="col-sm-4">
<button type="submit" class="btn btn-sm btn-primary" ng-click="save()"><i class="fa fa-dot-circle-o"></i>
Save</button>
</div>
皈依舞
慕桂英546537
相关分类