<html>
<head>
<script type="text/javascript"
src="http://angular.getangular.com/angular-1.0a.js#database=docsdb"></script>
</head>
<body>
<div ng-init="customers = [{$id:'th42398uo432', name:'John', address1:'123 Main St', address2:'Anytown, CA 12345'}, {$id:'uth38923htu', name:'Mary', address1:'456 Broadway Blvd', address2:'New York, NY 01234'}]"></div>
Choose a customer:
<select name="invoice.customerId">
<option value="">-- Chose a Customer --</option>
<option ng-repeat="customer in customers" value="{{customer.$id}}">{{customer.name}}</option>
</select><br>
<hr>
<pre>invoice = {{invoice}}</pre>
<hr>
<div ng-eval="selectedCustomer = customers.$findById(invoice.customerId)">
You Chose Customer: <br>
{{selectedCustomer.name}} <br>
{{selectedCustomer.address1}} <br>
{{selectedCustomer.address2}} <br>
</div>
</body>
</html>