Angular: Empty Fiddle

http://angularjs.org/

by boneskull

HTML

<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
    <select ng-model="client" ng-options="client.id as client.name for client in clients"></select>
    <pre>{{client}}</pre>
</div>

JavaScript

var myApp = angular.module('myApp', []);

//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});

function MyCtrl($scope) {
    
    $scope.client = {};

    $scope.clients = [
        {
        id: 'foo',
        name: 'bar'},
    {
        id: 'baz',
        name: 'spam'}
                ];

}