Am facing problem in displaying selected value in angular dropdown. it works when i give like this
$scope.selectedItem = $scope.items[1];
not w
In angular, Arrays and objects are passed by reference while strings, numbers and booleans are passed by value. So, angular interprets $scope.items[1]
and { name: 'two', age: 27 }
as two different objects. That's why your binding fails when you do $scope.selectedItem = { name: 'two', age: 27 };
directly and find it in '$scope.items'.