<!DOCTYPE html> <div ng-app="myApp" ng-controller="myCtrl"> <p>Select a car:</p> <select ng-model="selectedCar" ng-options="x for (x, y) in cars"> <h1>You selected: {{selectedCar}}</h1> </div> <p>This example demonstrates the use of an object as the data source when creating a dropdown list.</p> <script> </body> </html> |
Select a car: You selected: {{selectedCar}}This example demonstrates the use of an object as the data source when creating a dropdown list. |