I wanted to set selected option in my dropdown list.
I have two ways of passing data into selects ng-model
first: $scope.selectedTeam = $scope.teams[31];
second: $scope.selectedTeam = selectedTeamSrvs.getTeam()
my html select looks like this:
<select ng-model="selectedTeam"
ng-options="team as team.name for team in teams | orderBy:'ID'">
</select>
and JSON.stringify($scope.teams[31]) === JSON.stringify(selectedTeamSrvs.getTeam()) gives true.
Then why only first option sets selected option correctly?