Angular select

test app

by Mirosław Hajkowski

HTML

<div ng-app>
    
    <h2>Select location</h2>
    <div ng-controller="myCtrl">
        <select ng-model="blah" 
            ng-init="blah = blah || items[1].ID"
        ng-options="item.ID as item.Title for item in items"></select>
        <div>{{blah}}</div>
    </div>
</div>

JavaScript

function myCtrl($scope) {
    $scope.items = [{
        ID: '000001',
        Title: 'Chicago'
    }, {
        ID: '000002',
        Title: 'New York'
    }, {
        ID: '000003',
        Title: 'Washington'
    }, ];
}